-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
50 lines (47 loc) · 2.41 KB
/
MainWindow.xaml
File metadata and controls
50 lines (47 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<Window x:Class="QuadTreeSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Name="Window"
Title="QuadTree Sample" Height="700" Width="900" WindowStartupLocation="CenterScreen">
<Grid Background="Beige">
<!-- Canvas for adding points and quads rectangles -->
<Canvas
x:Name="CanvasControl"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="White">
<Canvas.LayoutTransform>
<ScaleTransform
ScaleX="{Binding CanvasScale, ElementName=Window}"
ScaleY="{Binding CanvasScale, ElementName=Window}" />
</Canvas.LayoutTransform>
</Canvas>
<!-- Stats -->
<Border Background="#FFCCCCCC" HorizontalAlignment="Left" VerticalAlignment="Top" IsHitTestVisible="False"
Padding="5" Margin="5" CornerRadius="3">
<StackPanel Orientation="Vertical" MinWidth="60" MinHeight="20">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Brush size: " />
<TextBlock Text="{Binding BrushSize, ElementName=Window}" />
</StackPanel>
<TextBlock Text="Use +/- keys to change the brush size" />
<TextBlock Text="Use left mouse button to draw the area" />
<TextBlock Text="Use right mouse button to clear the area" />
<TextBlock Text="Press S to Save the quadtree" />
<TextBlock Text="Press L to Load the quadtree" />
<TextBlock Text="Press Escape to clear the screen" />
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
<TextBlock Text="Points: " />
<TextBlock Text="{Binding StatsPointsCount, ElementName=Window}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="QuadTree nodes: " />
<TextBlock Text="{Binding StatsQuadTreeNodesCount, ElementName=Window}" />
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Window>