This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
MainWindow.xaml
163 lines (148 loc) · 9.25 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<Controls:MetroWindow x:Class="DR2Rallymaster.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:DR2Rallymaster"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Icons="clr-namespace:MahApps.Metro.IconPacks;assembly=MahApps.Metro.IconPacks.Modern"
mc:Ignorable="d"
Title="DR2 Rallymaster v1.3" Height="600" MinHeight="600" Width="800" SizeToContent="Height"
Closing="MetroWindow_Closing">
<!-- Creates the "RightWindowCommand" that has the settings cog -->
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<Button Name="btnSettings" Click="Settings_Click">
<Icons:Modern Width="15" Height="15" Kind="Settings" />
<Button.ContextMenu>
<ContextMenu>
<MenuItem Name="menuItemThemes" Header="Base Themes" />
<MenuItem Name="menuItemAccents" Header="Accents" />
<MenuItem Name="baseUrlMenuItem" Header="Base URL">
<TextBox x:Name="baseUrlTextBox" PreviewLostKeyboardFocus="OnPreviewLostKeyboardFocus" />
</MenuItem>
</ContextMenu>
</Button.ContextMenu>
</Button>
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>
<!-- Main content body-->
<StackPanel>
<!-- search bar -->
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="5" />
<RowDefinition Height="28" />
<RowDefinition Height="5" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- <TextBlock Grid.Row="1" Grid.Column="0" Text="Step 1)" FontSize="14" VerticalAlignment="Center" />-->
<Button Name="logIn" Grid.Row="1" Grid.Column="1" Click="LogIn_Click" Content="Log Into Racenet" Style="{StaticResource SquareButtonStyle}" />
<!--<TextBlock Grid.Row="1" Grid.Column="3" Text="Step 2)" FontSize="14" VerticalAlignment="Center" />-->
<TextBox Name="clubId" Grid.Row="1" Grid.Column="4" VerticalContentAlignment="Center"
Controls:TextBoxHelper.Watermark="Club ID"
Controls:TextBoxHelper.ClearTextButton="True" />
<Button Name="clubSearch" Grid.Row="1" Grid.Column="6" Click="ClubSearch_Click" Content="Search for Club" Style="{StaticResource SquareButtonStyle}" />
<Controls:ProgressRing Name="searchProgressRing" Grid.Row="1" Grid.Column="8" Width="24" IsActive="False" />
<TextBlock x:Name="statusLabel" Grid.Row="1" Grid.Column="9" Text="fetching data from racenet..." VerticalAlignment="Bottom" Visibility="Hidden" />
</Grid>
<!-- Search result data -->
<GroupBox Header="Club Info">
<StackPanel>
<!-- Club Name -->
<TextBlock Name="clubNameLabel" Text="Instructions:" HorizontalAlignment="Center" FontSize="25" />
<!-- Club Description -->
<TextBlock Name="clubDescLabel" HorizontalAlignment="Center" TextWrapping="Wrap">
1) Log into Racenet using the aptly named "log into racenet" button above <LineBreak />
2) Wait for authentication to be setup in the tool <LineBreak />
3) Search for the Club using the Club ID, these are the digits at the end of the club URL <LineBreak />
    Example: https://dirtrally2.dirtgame.com/clubs/club/183582 is Club ID: 183582
</TextBlock>
</StackPanel>
</GroupBox>
<!-- Club Data -->
<GroupBox Header="Current Club Data">
<Grid Name="resultsGrid" Visibility="Visible">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<!-- Header -->
<RowDefinition Height="*" />
<!-- Content -->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<!-- Championship list -->
<ColumnDefinition Width="200" />
<!-- Event list -->
<ColumnDefinition Width="*" />
<!-- Metadata -->
</Grid.ColumnDefinitions>
<!-- Header -->
<TextBlock Grid.Row="0" Grid.Column="0" FontSize="15" Text="Championships" HorizontalAlignment="Center" Margin="0,1,0,0" />
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="15" Text="Events" HorizontalAlignment="Center" Margin="0,1,0,0" />
<!-- <TextBlock Grid.Row="0" Grid.Column="2" FontSize="15" Text="Info" HorizontalAlignment="Center" />-->
<!-- Championships -->
<ListBox Name="championshipsListBox" Grid.Column="0" Grid.Row="1" BorderThickness="0" VerticalAlignment="Stretch" SelectionChanged="ChampionshipListBox_Selected">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- Events -->
<ListBox Name="eventsListBox" Grid.Column="1" Grid.Row="1" BorderThickness="0" VerticalAlignment="Stretch" SelectionChanged="EventsListBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- Info Panel -->
<TabControl Grid.Column="2" Grid.Row="0" Grid.RowSpan="2">
<TabControl.Resources>
<Style TargetType="{x:Type TabPanel}">
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</TabControl.Resources>
<TabItem Name="clubInfoTab" Header="Club Info" Controls:ControlsHelper.HeaderFontSize="15">
<DataGrid Name="clubInfoDataGrid" AutoGenerateColumns="False" IsReadOnly="True" HeadersVisibility="None" HorizontalAlignment="Center" MinRowHeight="18" RowHeight="18" MaxHeight="500" VerticalScrollBarVisibility="Auto">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Key}" />
<DataGridTextColumn Binding="{Binding Value}" />
</DataGrid.Columns>
</DataGrid>
</TabItem>
<TabItem Name="championshipInfoTab" Header="Championship Info" Controls:ControlsHelper.HeaderFontSize="15" >
<DataGrid Name="championshipInfoDataGrid" AutoGenerateColumns="False" IsReadOnly="True" HeadersVisibility="None" HorizontalAlignment="Center" MinRowHeight="18" RowHeight="18" MaxHeight="300" VerticalScrollBarVisibility="Auto">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Key}" />
<DataGridTextColumn Binding="{Binding Value}" />
</DataGrid.Columns>
</DataGrid>
</TabItem>
<TabItem Name="eventInfoTab" Header="Event Info" Controls:ControlsHelper.HeaderFontSize="15" >
<DataGrid Name="eventInfoDataGrid" AutoGenerateColumns="False" IsReadOnly="True" HeadersVisibility="None" HorizontalAlignment="Center" MinRowHeight="18" RowHeight="18" MaxHeight="300" VerticalScrollBarVisibility="Auto">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Key}" />
<DataGridTextColumn Binding="{Binding Value}" />
</DataGrid.Columns>
</DataGrid>
</TabItem>
</TabControl>
</Grid>
</GroupBox>
<!-- Buttons to download results -->
<Button Name="btnGetStageResults" Click="GetStageResults_Click" Content="Export Stage Results" Width="200" VerticalAlignment="Center" Visibility="Hidden" Style="{StaticResource SquareButtonStyle}" />
</StackPanel>
</Controls:MetroWindow>