-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
91 lines (91 loc) · 4.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
85
86
87
88
89
90
91
<Window
x:Class="WpfApp.MainWindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:WpfApp.Converters"
Width="800"
Height="450"
Closing="Window_Closing"
Loaded="Window_Loaded"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<converters:IndexToBoolConverter x:Key="IndexToBoolConverter" />
<Style x:Key="ButtonStyle" TargetType="Button">
<Style.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard TargetProperty="(Button.Background).(SolidColorBrush.Color)">
<ColorAnimation
AutoReverse="True"
To="LightGreen"
Duration="0:0:0.5" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Menu>
<MenuItem Click="MenuItem_Click" Header="{DynamicResource settings}" />
</Menu>
<Grid
Grid.Row="0"
MaxWidth="500"
Margin="15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0">
<Label HorizontalAlignment="Center" Content="{DynamicResource firstTeam}" />
<ComboBox x:Name="firstTeamComboBox" SelectionChanged="firstTeamComboBox_SelectionChanged" />
<Button
x:Name="firstTeamButton"
Click="firstTeamButton_Click"
Content="{DynamicResource teamDetails}"
IsEnabled="{Binding SelectedIndex, ElementName=firstTeamComboBox, Converter={StaticResource IndexToBoolConverter}}"
Style="{StaticResource ButtonStyle}" />
</StackPanel>
<Label
x:Name="resultLabel"
Grid.Row="0"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="vs"
FontSize="20" />
<StackPanel Grid.Row="0" Grid.Column="2">
<Label HorizontalAlignment="Center" Content="{DynamicResource secondTeam}" />
<ComboBox x:Name="secondTeamComboBox" SelectionChanged="secondTeamComboBox_SelectionChanged" />
<Button
x:Name="secondTeamButton"
Click="secondTeamButton_Click"
Content="{DynamicResource teamDetails}"
IsEnabled="{Binding SelectedIndex, ElementName=secondTeamComboBox, Converter={StaticResource IndexToBoolConverter}}"
Style="{StaticResource ButtonStyle}" />
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Image Source="/Images/football-field.jpg" Stretch="Fill" />
<UniformGrid x:Name="fieldGrid" Columns="8">
<UniformGrid x:Name="firstTeamGoalie" Columns="1" />
<UniformGrid x:Name="firstTeamDefender" Columns="1" />
<UniformGrid x:Name="firstTeamMidfield" Columns="1" />
<UniformGrid x:Name="firstTeamForward" Columns="1" />
<UniformGrid x:Name="secondTeamForward" Columns="1" />
<UniformGrid x:Name="secondTeamMidfield" Columns="1" />
<UniformGrid x:Name="secondTeamDefender" Columns="1" />
<UniformGrid x:Name="secondTeamGoalie" Columns="1" />
</UniformGrid>
</Grid>
</Grid>
</Window>