Check out the following XAML and notice the difference in Fill of the following three rectangles.
<StackPanel>
<Rectangle Stroke="Black" StrokeThickness="3" Width="100" Height="100"
Margin="5" MouseLeftButtonUp="rect_MouseLeftButtonUp" Fill="Transparent" />
<Rectangle Stroke="Black" StrokeThickness="3" Width="100" Height="100"
Margin="5" MouseLeftButtonUp="rect_MouseLeftButtonUp" Fill="{x:Null}" />
<Rectangle Stroke="Black" StrokeThickness="3" Width="100" Height="100"
Margin="5" MouseLeftButtonUp="rect_MouseLeftButtonUp" />
</StackPanel>
As you can see, the first rectangle has Transparent fill, 2nd one has Null fill, and the third one doesn't talk about Fill at all. You can
easily guess how it would appear…

So, what's the difference? Well… it is a very subtle one. Write a code for rect_MouseLeftButtonUp as follows…
private void rect_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("Test");
}
You will find that the first rectangle will respond wholly to click. The border, and the empty area as well. For the 2nd and 3rd
rectangle, you will not get any message box if you click in the empty area. Borders will respond though. Thus, 2nd and 3rd are rectangles are similar.
Until next time,
Rahul
Quote of the day:
I never teach my pupils. I only attempt to provide the conditions in which they can learn. - Albert Einstein