Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created July 29, 2019 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BMU-Verlag/fbe386a8728e9320553a48f430ec943c to your computer and use it in GitHub Desktop.
Save BMU-Verlag/fbe386a8728e9320553a48f430ec943c to your computer and use it in GitHub Desktop.
<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"
ResizeMode="NoResize"
Title="Tic Tac Toe" Height="600" Width="500">
<Window.Resources>
<Style TargetType="Label">
<Setter Property="Background" Value="LightGray"/>
<Setter Property="FontSize" Value="20" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style TargetType="Button" x:Key="CellStyle">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="DarkGray" />
<Setter Property="FontSize" Value="65" />
</Style>
<Style TargetType="Button" x:Key="ButtonStyle">
<Setter Property="Background" Value="PaleGreen"/>
<Setter Property="FontSize" Value="20" />
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Name="GameInformation"></Label>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button Click="Button_Click" Name="Button0_0" Grid.Column="0" Grid.Row="0" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button0_1" Grid.Column="0" Grid.Row="1" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button0_2" Grid.Column="0" Grid.Row="2" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button1_0" Grid.Column="1" Grid.Row="0" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button1_1" Grid.Column="1" Grid.Row="1" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button1_2" Grid.Column="1" Grid.Row="2" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button2_0" Grid.Column="2" Grid.Row="0" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button2_1" Grid.Column="2" Grid.Row="1" Style="{StaticResource CellStyle}" />
<Button Click="Button_Click" Name="Button2_2" Grid.Column="2" Grid.Row="2" Style="{StaticResource CellStyle}" />
</Grid>
<Button Click="StartButton_Click" Name="StartButton" Grid.Row="2" Style="{StaticResource ButtonStyle}">Neues Spiel starten</Button>
</Grid>
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment