MainWindow.xaml
 1  <Window
 2      x:Class="FancyZone_HitTest.MainWindow"
 3      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 4      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 5      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 6      xmlns:local="clr-namespace:FancyZone_HitTest"
 7      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 8      Title="MainWindow"
 9      Width="1024"
10      Height="768"
11      mc:Ignorable="d">
12      <Grid>
13          <Grid.ColumnDefinitions>
14              <ColumnDefinition />
15              <ColumnDefinition Width="200" />
16          </Grid.ColumnDefinitions>
17          <Grid Name="hitTestGrid" MouseMove="Grid_MouseMove">
18              <Grid.ColumnDefinitions>
19                  <ColumnDefinition Width="*" />
20                  <ColumnDefinition Width="*" />
21                  <ColumnDefinition Width="*" />
22              </Grid.ColumnDefinitions>
23  
24  
25              <Rectangle
26                  Name="a"
27                  Grid.Column="0"
28                  Fill="#ff0000" />
29              <Rectangle
30                  Name="b"
31                  Grid.Column="1"
32                  Fill="#00ff00" />
33              <Rectangle
34                  Name="c"
35                  Grid.Column="2"
36                  Fill="#0000ff" />
37              <Rectangle
38                  Name="d"
39                  Grid.ColumnSpan="3"
40                  Width="550"
41                  Height="500"
42                  Fill="#aabbff" />
43              <!--  Height="600"  -->
44              <Rectangle
45                  Name="f"
46                  Grid.ColumnSpan="3"
47                  Width="400"
48                  Height="400"
49                  Fill="#aabbff" />
50              <Rectangle
51                  Name="e"
52                  Grid.ColumnSpan="3"
53                  Fill="Orange" />
54  
55          </Grid>
56          <StackPanel Grid.Column="1">
57              <TextBlock>Calculations</TextBlock>
58              <TextBlock x:Name="itemsHit" />
59          </StackPanel>
60      </Grid>
61  </Window>