-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
83 lines (76 loc) · 4.55 KB
/
MainWindow.xaml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<Window x:Class="GameOfLife.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"
xmlns:local="clr-namespace:GameOfLife"
Icon="Graphics/circle.png"
mc:Ignorable="d"
Title="Game Of Life" Height="800" Width="615" WindowStartupLocation="CenterScreen"
ResizeMode="NoResize">
<DockPanel Name="TopMenuBar">
<Menu DockPanel.Dock="Top">
<MenuItem Header="_Settings">
<MenuItem Header="Save" Click="Save_OnClick" />
<Separator />
<MenuItem Header="Load" Click="Load_OnClick" />
<Separator />
<MenuItem Header="Exit" Click="Exit_OnClick" />
</MenuItem>
</Menu>
<Grid DockPanel.Dock="Top" Name="GridGameSpace" Background="White" Width="600" Height="600" />
<Grid DockPanel.Dock="Bottom" Name="GridConsolePanel" Height="200" Width="600">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Canvas Grid.Column="0" Background="Gainsboro">
<DockPanel>
<DockPanel DockPanel.Dock="Top" Margin="0,10,0,10">
<TextBlock DockPanel.Dock="Right">Board Size</TextBlock>
<TextBlock
Text="{Binding ElementName=sliderBoardSize, Path=Value, UpdateSourceTrigger=PropertyChanged}"
DockPanel.Dock="Right" TextAlignment="Center" Width="20" />
<TextBlock DockPanel.Dock="Right">x</TextBlock>
<TextBlock
Text="{Binding ElementName=sliderBoardSize, Path=Value, UpdateSourceTrigger=PropertyChanged}"
DockPanel.Dock="Right" TextAlignment="Center" Width="20" />
<Slider Minimum="5" Maximum="50" TickPlacement="BottomRight" TickFrequency="1"
IsSnapToTickEnabled="True" Name="sliderBoardSize" Width="190" Value="{Binding BoardSize}"
/>
</DockPanel>
<DockPanel DockPanel.Dock="Bottom">
<Button DockPanel.Dock="Left" Name="ClearButton" Height="40" Width="110" Margin="10,10,10,10"
Click="ClearButton_OnClick">
Clear
</Button>
<Button DockPanel.Dock="Right" Name="RandomButton" Height="40" Width="120" Margin="10,10,10,10" Click="RandomButton_OnClick" >Random Distribution</Button>
</DockPanel>
</DockPanel>
</Canvas>
<Canvas Grid.Column="1" Background="Silver">
<DockPanel>
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<Button Name="NextGeneration" VerticalAlignment="Top" Height="30" Margin="10,10,5,30"
Click="NextGeneration_OnClick">
Next Generation
</Button>
<Button Name="AutomaticGeneretionsButton" VerticalAlignment="Top" Height="30" Margin="5,10,5,30" FontSize="10"
Click="AutomaticGeneretions_OnClick">
Automatic Generations
</Button>
<Button Name="StopButton" VerticalAlignment="Top" Height="30" Width="60" Margin="5,10,10,30" Click="StopButton_OnClick">Stop</Button>
</StackPanel>
<DockPanel DockPanel.Dock="Bottom">
<TextBlock DockPanel.Dock="Right">sec</TextBlock>
<TextBlock
Text="{Binding ElementName=frequencyOfChangingGenerations, Path=Value, UpdateSourceTrigger=PropertyChanged, StringFormat=N2}"
DockPanel.Dock="Right" TextAlignment="Right" Width="40" Margin="0,0,5,0"/>
<Slider Minimum="0.05" Maximum="1" TickPlacement="BottomRight" TickFrequency="0.05"
IsSnapToTickEnabled="True" Name="frequencyOfChangingGenerations" Value="{Binding TimeInterval}"/>
</DockPanel>
</DockPanel>
</Canvas>
</Grid>
</DockPanel>
</Window>