-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
84 lines (77 loc) · 3.1 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
84
<Window x:Class="TicTacToe.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:TicTacToe"
mc:Ignorable="d"
Title="Tic Tac Toe" Height="450" Width="800"
FontFamily="Segoe UI Light"
Background="{StaticResource BackgroundColor}">
<Viewbox>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TurnPanel"
Orientation="Horizontal"
HorizontalAlignment="Center">
<TextBlock FontSize="54"
Text="Player:"/>
<Image x:Name="PlayerImage"
Source="Assets/X15.png"
Height="75"/>
</StackPanel>
<Canvas x:Name="GameCanvas"
Grid.Row="1"
Width="300"
Height="300"
Margin="30">
<UniformGrid x:Name="GameGrid"
Width="300"
Height="300"
Rows="3"
Columns="3"
MouseDown="GameGrid_Click">
<UniformGrid.Background>
<ImageBrush ImageSource="Assets/Grid.png"/>
</UniformGrid.Background>
</UniformGrid>
<Line x:Name="Line"
Stroke="{StaticResource LineColor}"
StrokeThickness="10"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
Visibility="Hidden"/>
</Canvas>
<Grid x:Name="EndScreen"
Grid.RowSpan="2"
Background="{StaticResource BackgroundColor}"
Visibility="Hidden">
<StackPanel Orientation="Vertical"
VerticalAlignment="Center">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<TextBlock x:Name="ResultText"
FontSize="54"
Text="Winner: "
Margin="0,0,0,15">
</TextBlock>
<Image x:Name="WinnerImage"
Height="75">
</Image>
</StackPanel>
<Button Content="Play Again"
Background="{StaticResource ButtonColor}"
FontSize="34"
Width="200"
Margin="0,20,0,0"
Padding="0,0,0,5"
BorderBrush="Black"
Click="Button_Click"/>
</StackPanel>
</Grid>
</Grid>
</Viewbox>
</Window>