-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.xaml
265 lines (260 loc) · 16.7 KB
/
MainPage.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<Page
x:Class="encounter_difficulty.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Grid.Background>
<ImageBrush Stretch="Fill" ImageSource="Assets\parchment-background.png" />
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="35*" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="65*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="20*" />
<RowDefinition Height="auto" />
<RowDefinition Height="80*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*" />
<ColumnDefinition Width="50*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<TextBlock Text="~Group Info~" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Row="0" Margin="12"
Style="{StaticResource TitleTextBlockStyle}"/>
<ComboBox x:Name="PartySize" Header="Players:" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="12"
ItemsSource="{x:Bind partySizeCollection}" MaxDropDownHeight="200" SelectionChanged="PartySize_SelectionChanged"/>
<ComboBox x:Name="PartyMembersLevel" Header="Level:" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="12"
ItemsSource="{x:Bind partyMembersLevelCollection}" MaxDropDownHeight="200" SelectionChanged="PartyMembersLevel_SelectionChanged"/>
</Grid>
<Grid Grid.Column="1" Margin="0 0 12 0">
<Grid.RowDefinitions>
<RowDefinition Height="20*" />
<RowDefinition Height="20*" />
<RowDefinition Height="20*" />
<RowDefinition Height="20*" />
<RowDefinition Height="20*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Party's XP Threshold" HorizontalAlignment="Right" VerticalAlignment="Center" FontWeight="Bold" Margin="0, 12, 0, 0"/>
<TextBlock Grid.Row="1" x:Name="EasyEncounterExp" Text="Easy: 0 exp" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<TextBlock Grid.Row="2" x:Name="MediumEncounterExp" Text="Medium: 0 exp" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<TextBlock Grid.Row="3" x:Name="HardEncounterExp" Text="Hard: 0 exp" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<TextBlock Grid.Row="4" x:Name="DeadlyEncounterExp" Text="Deadly: 0 exp" HorizontalAlignment="Right" VerticalAlignment="Center"/>
</Grid>
</Grid>
<MenuFlyoutSeparator Grid.Row="1"/>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="60*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBlock Text="~Encounter Info~" VerticalAlignment="Top" HorizontalAlignment="Center" Grid.Row="0" Margin="12"
Style="{StaticResource TitleTextBlockStyle}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ListView x:Name="MonsterEncounterList" Margin="12" Grid.Row="0"
IsItemClickEnabled="True"
ItemClick="MonsterEncounterList_ItemClick">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
<ListViewItemPresenter ContentMargin="0" Padding="0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
<ListView.HeaderTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*" />
<ColumnDefinition Width="10*" />
<ColumnDefinition Width="20*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="Black" BorderThickness="1">
<TextBlock Text="Name" Margin="5" FontWeight="Bold"/>
</Border>
<Border Grid.Column="1" BorderBrush="Black" BorderThickness="0, 1, 1, 1">
<TextBlock Text="CR" Margin="5" FontWeight="Bold"/>
</Border>
<Border Grid.Column="2" BorderBrush="Black" BorderThickness="0, 1, 1, 1">
<TextBlock Text="XP" Margin="5" FontWeight="Bold" />
</Border>
</Grid>
</DataTemplate>
</ListView.HeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*" />
<ColumnDefinition Width="10*" />
<ColumnDefinition Width="20*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="Gray" BorderThickness="0,0,0.5,0.5">
<TextBlock Text="{Binding Name}" Margin="5" Style="{ThemeResource SubtitleTextBlockStyle}" FontWeight="Light"/>
</Border>
<Border Grid.Column="1" BorderBrush="Gray" BorderThickness="0,0,0.5,0.5">
<TextBlock Text="{Binding CR}" Margin="5" VerticalAlignment="Center"/>
</Border>
<Border Grid.Column="2" BorderBrush="Gray" BorderThickness="0,0,0.5,0.5">
<TextBlock Text="{Binding XP}" Margin="5" VerticalAlignment="Center"/>
</Border>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<TextBlock x:Name="ApplicationHelpText" Grid.Row="1" Margin="12" TextWrapping="WrapWholeWords" Style="{StaticResource SubtitleTextBlockStyle}" FontWeight="SemiLight">
The encounter contains the selected monsters, with their <Bold>Combat Rating</Bold> and <Bold>Experience Points</Bold>.
<LineBreak/><LineBreak/>To create an encounter, add monsters from the right list, <Italic>by clicking an item</Italic>.
<LineBreak/><LineBreak/>Monsters can be removed from the left list, <Italic>by clicking an item</Italic>.
</TextBlock>
</Grid>
<MenuFlyoutSeparator Grid.Row="2"/>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*" />
<ColumnDefinition Width="50*" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="EncounterDifficulty" Grid.Column="0" Text="Difficulty: " VerticalAlignment="Top" HorizontalAlignment="Left" Margin="12"
Style="{StaticResource TitleTextBlockStyle}"/>
<Grid Grid.Column="1" Margin="0 0 12 12">
<Grid.RowDefinitions>
<RowDefinition Height="25*" />
<RowDefinition Height="25*" />
<RowDefinition Height="25*" />
<RowDefinition Height="25*" />
</Grid.RowDefinitions>
<TextBlock x:Name="TotalXP" Grid.Row="0" Text="Total XP: 0" HorizontalAlignment="Right"
Style="{StaticResource SubtitleTextBlockStyle}"/>
<TextBlock x:Name="PlayerXP" Grid.Row="1" Text="(0 per player)" HorizontalAlignment="Right"/>
<TextBlock x:Name="TotalAdjustedXP" Grid.Row="2" Text="Adjusted XP: 0" HorizontalAlignment="Right"
Style="{StaticResource SubtitleTextBlockStyle}"/>
<TextBlock x:Name="PlayerAdjustedXP" Grid.Row="3" Text="(0 per player)" HorizontalAlignment="Right"/>
</Grid>
</Grid>
</Grid>
</Grid>
<Border Grid.Column="1" Background="Gray" Width="1" Margin="0 12 0 12"/>
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="70*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="85*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<AutoSuggestBox x:Name="SearchBox" PlaceholderText="Search for a monster..." QueryIcon="Find" Margin="12" Grid.Column="0"
Header="List of Monsters:"
TextChanged="AutoSuggestBox_TextChanged"
QuerySubmitted="AutoSuggestBox_QuerySubmitted"/>
<ComboBox x:Name="PageSize" Header="Page Size:" HorizontalAlignment="Center" Grid.Column="1" Margin="12"
ItemsSource="{x:Bind pageSizeOptions}" MaxDropDownHeight="200" SelectionChanged="PageSize_SelectionChanged"/>
</Grid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="100*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="NoInternetError" Grid.Row="0" Margin="12" TextWrapping="WrapWholeWords" Style="{StaticResource SubtitleTextBlockStyle}" FontWeight="SemiLight" Visibility="Collapsed">
No internet connection was found. Please connect to the internet and <Bold>restart</Bold> the application.
</TextBlock>
<ListView x:Name="DisplayMonsterList" Margin="12" Grid.Row="1"
IsItemClickEnabled="True"
ItemClick="DisplayMonsterList_ItemClick"
ItemsSource ="{x:Bind displayMonsterList}">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
<ListViewItemPresenter ContentMargin="0" Padding="0" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
<ListView.HeaderTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30*" />
<ColumnDefinition Width="10*" />
<ColumnDefinition Width="20*" />
<ColumnDefinition Width="20*" />
<ColumnDefinition Width="20*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="Black" BorderThickness="1">
<TextBlock Text="Name" Margin="5" FontWeight="Bold"/>
</Border>
<Border Grid.Column="1" BorderBrush="Black" BorderThickness="0, 1, 1, 1">
<TextBlock Text="CR" Margin="5" FontWeight="Bold"/>
</Border>
<Border Grid.Column="2" BorderBrush="Black" BorderThickness="0, 1, 1, 1">
<TextBlock Text="Size" Margin="5" FontWeight="Bold" />
</Border>
<Border Grid.Column="3" BorderBrush="Black" BorderThickness="0, 1, 1, 1">
<TextBlock Text="Type" Margin="5" FontWeight="Bold"/>
</Border>
<Border Grid.Column="4" BorderBrush="Black" BorderThickness="0, 1, 1, 1">
<TextBlock Text="Alignment" Margin="5" FontWeight="Bold"/>
</Border>
</Grid>
</DataTemplate>
</ListView.HeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30*" />
<ColumnDefinition Width="10*" />
<ColumnDefinition Width="20*" />
<ColumnDefinition Width="20*" />
<ColumnDefinition Width="20*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="Gray" BorderThickness="0,0,0.5,0.5">
<TextBlock Text="{Binding Name}" Margin="5" Style="{ThemeResource TitleTextBlockStyle}" FontWeight="Light"/>
</Border>
<Border Grid.Column="1" BorderBrush="Gray" BorderThickness="0,0,0.5,0.5">
<TextBlock Text="{Binding CR}" Margin="5" VerticalAlignment="Center"/>
</Border>
<Border Grid.Column="2" BorderBrush="Gray" BorderThickness="0,0,0.5,0.5">
<TextBlock Text="{Binding Size}" Margin="5" VerticalAlignment="Center"/>
</Border>
<Border Grid.Column="3" BorderBrush="Gray" BorderThickness="0,0,0.5,0.5">
<TextBlock Text="{Binding Type}" Margin="5" VerticalAlignment="Center"/>
</Border>
<Border Grid.Column="4" BorderBrush="Gray" BorderThickness="0,0,0,0.5">
<TextBlock Text="{Binding Alignment}" Margin="5" VerticalAlignment="Center"/>
</Border>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
<Grid Grid.Row="2" Margin="12">
<Button x:Name="PreviousButton" Content="Previous" Click="PreviousButton_Click" Width="100" HorizontalAlignment="Left"/>
<Button x:Name="NextButton" Content="Next" Click="NextButton_Click" Width="100" HorizontalAlignment="Right"/>
</Grid>
</Grid>
</Grid>
</Page>