TicTacToe/tictactoe/MainWindow.xaml
2023-03-13 21:49:24 +01:00

53 lines
3.2 KiB
XML

<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"
xmlns:c="clr-namespace:TicTacToe"
mc:Ignorable="d"
Title="MainWindow" Height="200" Width="200" ResizeMode="NoResize">
<Window.Resources>
<c:TicTacToeViewModel x:Key="viewModel" />
</Window.Resources>
<Grid DataContext="{StaticResource viewModel}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="0" Grid.Column="0">
<Button Content="{ Binding Field1 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="1" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="1" Grid.Column="0">
<Button Content="{ Binding Field2 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="2" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="2" Grid.Column="0">
<Button Content="{ Binding Field3 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="3" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="0" Grid.Column="1">
<Button Content="{ Binding Field4 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="4" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="1" Grid.Column="1">
<Button Content="{ Binding Field5 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="5" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="2" Grid.Column="1">
<Button Content="{ Binding Field6 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="6" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="0" Grid.Column="2">
<Button Content="{ Binding Field7 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="7" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="1" Grid.Column="2">
<Button Content="{ Binding Field8 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="8" />
</Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="2" Grid.Column="2">
<Button Content="{ Binding Field9 }" Style="{ StaticResource Field }" Command="{ Binding FieldClickCommand }" CommandParameter="9" />
</Border>
</Grid>
</Window>