-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathLeaderboardsPage.xaml
More file actions
269 lines (236 loc) · 15.7 KB
/
LeaderboardsPage.xaml
File metadata and controls
269 lines (236 loc) · 15.7 KB
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
266
267
268
269
<!--
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. -->
<local:BasePage
x:Class="PhotoSharingApp.Universal.Views.LeaderboardsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:PhotoSharingApp.Universal.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:design="using:PhotoSharingApp.Universal.ViewModels.Design"
xmlns:controls="using:PhotoSharingApp.Universal.Controls"
xmlns:valueConverters="using:PhotoSharingApp.Universal.ValueConverters"
mc:Ignorable="d"
x:Name="pageRoot"
d:DataContext="{d:DesignInstance design:LeaderboardDesignViewModel, IsDesignTimeCreatable=True}">
<Page.Resources>
<Style x:Key="ListViewItemContainerStyle" TargetType="ListViewItem">
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="TabNavigation" Value="Local" />
<Setter Property="IsHoldingEnabled" Value="True" />
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="MinWidth" Value="{ThemeResource ListViewItemMinWidth}" />
<Setter Property="MinHeight" Value="{ThemeResource ListViewItemMinHeight}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
<ListViewItemPresenter
CheckBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
ContentMargin="{TemplateBinding Padding}"
CheckMode="Inline"
ContentTransitions="{TemplateBinding ContentTransitions}"
CheckBoxBrush="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}"
DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"
DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}"
DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}"
FocusBorderBrush="{ThemeResource SystemControlForegroundAltHighBrush}"
FocusSecondaryBorderBrush="{ThemeResource SystemControlForegroundBaseHighBrush}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
PointerOverForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
PressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}"
PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}"
PointerOverBackground="Transparent"
ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}"
SelectedPressedBackground="{ThemeResource SystemControlHighlightListAccentHighBrush}"
SelectionCheckMarkVisualEnabled="True"
SelectedForeground="{ThemeResource SystemControlHighlightAltBaseHighBrush}"
SelectedPointerOverBackground="{ThemeResource SystemControlHighlightListAccentMediumBrush}"
SelectedBackground="{ThemeResource SystemControlHighlightListAccentLowBrush}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<valueConverters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</Page.Resources>
<Grid x:Name="layoutRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<controls:PageHeader Grid.ColumnSpan="3">
<controls:PageHeader.HeaderContent>
<TextBlock Text="{Binding PageHeaderText}" Style="{ThemeResource PageTitleTextBlockStyle}" />
</controls:PageHeader.HeaderContent>
</controls:PageHeader>
<Grid Row="1" Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"
VerticalAlignment="Stretch">
<ProgressRing IsActive="{Binding IsBusy}" Foreground="{StaticResource AppAccentColorBrush}"
Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}" />
</Grid>
<Hub x:Name="leaderboardHubControl" Grid.Row="1" HorizontalAlignment="Center"
Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter=True}">
<HubSection x:Name="userNetWorthHubSection" Padding="0">
<HubSection.HeaderTemplate>
<DataTemplate>
<TextBlock FontSize="{Binding HubSectionHeaderFontSize, ElementName=pageRoot}" Text="{Binding FirstHubHeaderText}" Foreground="Black" Margin="0,0,0,-5" />
</DataTemplate>
</HubSection.HeaderTemplate>
<DataTemplate>
<ListView ItemsSource="{Binding Leaderboard.MostGoldUsers}"
IsItemClickEnabled="False" SelectionMode="None"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemContainerStyle="{StaticResource ListViewItemContainerStyle}">
<ListView.ItemTemplate>
<DataTemplate>
<controls:LeaderboardsUserControl UserEntry="{Binding}"
NavigationCommand="{Binding DataContext.UserSelectedCommand, ElementName=layoutRoot}"
Height="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}"
Width="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DataTemplate>
</HubSection>
<HubSection x:Name="mostGoldGivenHubSection" Padding="0">
<HubSection.HeaderTemplate>
<DataTemplate>
<TextBlock FontSize="{Binding HubSectionHeaderFontSize, ElementName=pageRoot}" Text="{Binding SecondHubHeaderText}" Foreground="Black" Margin="0,0,0,-5" />
</DataTemplate>
</HubSection.HeaderTemplate>
<DataTemplate>
<ListView ItemsSource="{Binding Leaderboard.MostGivingUsers}" IsItemClickEnabled="False" SelectionMode="None"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemContainerStyle="{StaticResource ListViewItemContainerStyle}">
<ListView.ItemTemplate>
<DataTemplate>
<controls:LeaderboardsUserControl UserEntry="{Binding}"
NavigationCommand="{Binding DataContext.UserSelectedCommand, ElementName=layoutRoot}"
Height="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}"
Width="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DataTemplate>
</HubSection>
<HubSection x:Name="photoNetWorthHubSection" Padding="0">
<HubSection.HeaderTemplate>
<DataTemplate>
<TextBlock FontSize="{Binding HubSectionHeaderFontSize, ElementName=pageRoot}" Text="{Binding ThirdHubHeaderText}" Foreground="Black" Margin="0,0,0,-5" />
</DataTemplate>
</HubSection.HeaderTemplate>
<DataTemplate>
<ListView ItemsSource="{Binding Leaderboard.MostGoldPhotos}" IsItemClickEnabled="False" SelectionMode="None"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemContainerStyle="{StaticResource ListViewItemContainerStyle}">
<ListView.ItemTemplate>
<DataTemplate>
<controls:LeaderboardsPhotoControl PhotoEntry="{Binding}"
NavigationCommand="{Binding DataContext.PhotoSelectedCommand, ElementName=layoutRoot}"
Height="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}"
Width="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DataTemplate>
</HubSection>
<HubSection x:Name="categoryNetWorthHubSection" Padding="0">
<HubSection.HeaderTemplate>
<DataTemplate>
<TextBlock FontSize="{Binding HubSectionHeaderFontSize, ElementName=pageRoot}" Text="{Binding FourthHubHeaderText}" Foreground="Black" Margin="0,0,0,-5" />
</DataTemplate>
</HubSection.HeaderTemplate>
<DataTemplate>
<ListView ItemsSource="{Binding Leaderboard.MostGoldCategories}" IsItemClickEnabled="False" SelectionMode="None"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
ItemContainerStyle="{StaticResource ListViewItemContainerStyle}">
<ListView.ItemTemplate>
<DataTemplate>
<controls:LeaderboardsCategoryControl CategoryEntry="{Binding}"
NavigationCommand="{Binding DataContext.CategorySelectedCommand, ElementName=layoutRoot}"
Height="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}"
Width="{Binding LeaderboardsControlWidthAndHeight, ElementName=pageRoot}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DataTemplate>
</HubSection>
</Hub>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="1400" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="userNetWorthHubSection.Margin" Value="12" />
<Setter Target="mostGoldGivenHubSection.Margin" Value="12" />
<Setter Target="photoNetWorthHubSection.Margin" Value="12" />
<Setter Target="categoryNetWorthHubSection.Margin" Value="12" />
</VisualState.Setters>
</VisualState>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="900" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="userNetWorthHubSection.Margin" Value="9" />
<Setter Target="mostGoldGivenHubSection.Margin" Value="9" />
<Setter Target="photoNetWorthHubSection.Margin" Value="9" />
<Setter Target="categoryNetWorthHubSection.Margin" Value="9" />
</VisualState.Setters>
</VisualState>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="720" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="leaderboardHubControl.Orientation" Value="Horizontal" />
<Setter Target="leaderboardHubControl.HorizontalAlignment" Value="Center" />
<Setter Target="userNetWorthHubSection.Margin" Value="6" />
<Setter Target="mostGoldGivenHubSection.Margin" Value="6" />
<Setter Target="photoNetWorthHubSection.Margin" Value="6" />
<Setter Target="categoryNetWorthHubSection.Margin" Value="6" />
</VisualState.Setters>
</VisualState>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="leaderboardHubControl.Orientation" Value="Vertical" />
<Setter Target="leaderboardHubControl.HorizontalAlignment" Value="Stretch" />
<Setter Target="leaderboardHubControl.Margin" Value="18" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</local:BasePage>