/
HistoryPage.xaml
112 lines (110 loc) · 7.59 KB
/
HistoryPage.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
<Page
x:Class="MALClient.UWP.Pages.Main.HistoryPage"
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:xamlConverters="using:MALClient.UWP.Shared.XamlConverters"
xmlns:derived="using:MALClient.UWP.Shared.UserControls.Derived"
xmlns:items="using:MALClient.UWP.Shared.Items"
mc:Ignorable="d" DataContext="{Binding Source={StaticResource Locator},Path=History}">
<Page.Resources>
<xamlConverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Page.Resources>
<Grid Background="{ThemeResource BrushDeepBackground}">
<ScrollViewer>
<ItemsControl ItemsSource="{Binding History}" VerticalAlignment="Top">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<derived:TrueVariableWarpGrid/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="5" Padding="5" Background="{ThemeResource BrushAnimeItemBackground}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Background="{ThemeResource BrushAnimeItemInnerBackground}" BorderBrush="{StaticResource SystemControlBackgroundAccentBrush}" BorderThickness="1,0" Margin="-5">
<TextBlock Text="{Binding Key}" FontSize="26" Foreground="White" FontWeight="Medium" HorizontalAlignment="Center" Margin="0,5"/>
</Grid>
<GridView Grid.Row="1" ItemsSource="{Binding Value}" IsItemClickEnabled="True" ItemClick="AnimeItemOnClick">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid Orientation="Horizontal" ItemHeight="360" ItemWidth="500"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="Margin" Value="5"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Height" Value="350"/>
<Setter Property="Background" Value="{ThemeResource BrushAnimeItemInnerBackground}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
</Style>
</GridView.ItemContainerStyle>
<GridView.ItemContainerTransitions>
<TransitionCollection>
<PopupThemeTransition FromVerticalOffset="100" />
<AddDeleteThemeTransition />
<ReorderThemeTransition />
<RepositionThemeTransition />
</TransitionCollection>
</GridView.ItemContainerTransitions>
<GridView.ItemTemplate>
<DataTemplate>
<Grid Background="{ThemeResource BrushHamburgerInnerBackground}" BorderThickness="3,0,0,0" BorderBrush="{StaticResource SystemControlBackgroundAccentBrush}" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<items:AnimeGridItem IsRightTapEnabled="True" RightTapped="AnimeItemOnRightClick" HorizontalAlignment="Left" DataContext="{Binding Item1}"/>
<ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto" PointerPressed="HistoryScrollViewerOnPointerPressed" HorizontalAlignment="Stretch">
<ItemsControl ItemsSource="{Binding Item2}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel Margin="8,0,16,0" GroupPadding="0,0,0,0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,5">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ShowUnit}" />
<TextBlock Text="{Binding WatchedEpisode}" Margin="5,0" FontWeight="Medium"/>
</StackPanel>
<TextBlock Text="{Binding Date}" HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<TextBlock
Visibility="{Binding HistoryEmptyNoticeVisibility,Converter={StaticResource BoolToVisibilityConverter}}"
Text="Empty..." HorizontalAlignment="Center" VerticalAlignment="Center"
TextWrapping="WrapWholeWords" TextAlignment="Center" Foreground="#B9B9B9" />
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Visibility="{Binding LoadingVisibility,Converter={StaticResource BoolToVisibilityConverter}}"
Background="{ThemeResource BrushLoading}">
<ProgressRing
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="75" Height="75"
IsActive="True" />
</Grid>
</Grid>
</Page>