-
Notifications
You must be signed in to change notification settings - Fork 1
/
SelectionWindow.xaml
129 lines (124 loc) · 6.26 KB
/
SelectionWindow.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
<?xml version="1.0" encoding="utf-8" ?>
<Window
x:Class="Draggable.SelectionWindow"
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:local="using:Draggable"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid
x:Name="root"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.Resources>
<StaticResource x:Key="GridViewItemBackgroundSelected" ResourceKey="AccentFillColorDefaultBrush" />
<StaticResource x:Key="GridViewItemBackgroundSelectedPointerOver" ResourceKey="AccentFillColorSecondaryBrush" />
<StaticResource x:Key="GridViewItemForegroundSelected" ResourceKey="TextOnAccentFillColorPrimaryBrush" />
<DataTemplate x:Key="IconTemplate" x:DataType="local:AssetIndexItem">
<UserControl
PointerEntered="IconsTemplateOnPointerEntered"
PointerExited="IconsTemplateOnPointerExited"
PointerPressed="IconsTemplateOnPointerPressed">
<Border
x:Name="borderItem"
MinWidth="100"
MinHeight="120"
Margin="6"
Padding="4"
Background="#10000000"
BorderBrush="{ThemeResource GradientBackgroundBrush}"
BorderThickness="1"
CornerRadius="5">
<Grid x:Name="gridItem">
<Grid.RowDefinitions>
<RowDefinition x:Name="IndexColumn" Height="20" />
<RowDefinition x:Name="ImageColumn" Height="100" />
</Grid.RowDefinitions>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
<Setter Property="FontSize" Value="{StaticResource FontSizeSmall}" />
</Style>
</Grid.Resources>
<TextBlock
Grid.Row="0"
Margin="3,0,1,0"
Foreground="{ThemeResource GradientTitleBrush}"
Text="{x:Bind ClockName, Mode=OneWay}" />
<Image
Grid.Row="1"
Width="100"
Height="100"
Source="{x:Bind ClockImage, Mode=OneWay}"
Stretch="Uniform" />
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionState">
<VisualState x:Name="Default">
<!--<VisualState.Setters>
<Setter Target="borderItem.Background" Value="#10000000" />
<Setter Target="borderItem.BorderBrush" Value="{ThemeResource GradientBackgroundBrush}" />
<Setter Target="borderItem.BorderThickness" Value="1" />
</VisualState.Setters>-->
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Target="borderItem.Background" Value="{ThemeResource GradientBorderBrush}" />
<Setter Target="borderItem.BorderBrush" Value="{ThemeResource AccentFillColorDefaultBrush}" />
<Setter Target="borderItem.BorderThickness" Value="2" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
</UserControl>
</DataTemplate>
</Grid.Resources>
<!--#region [Custom TitleBar]-->
<Grid
x:Name="CustomTitleBar"
Grid.Row="0"
Height="30"
Margin="0">
<StackPanel Orientation="Horizontal">
<Image
Width="25"
Height="25"
Margin="4,1"
Source="ms-appx:///Assets/StoreLogo.png" />
<TextBlock
Margin="2,0"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind Title, Mode=OneWay}" />
</StackPanel>
</Grid>
<!--#endregion-->
<!--#region [Asset Content]-->
<Grid Grid.Row="1">
<ScrollViewer
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
AutomationProperties.Name="Assets">
<ItemsRepeater
x:Name="AssetsRepeater"
MinWidth="100"
Margin="10"
HorizontalAlignment="Stretch"
ItemTemplate="{StaticResource IconTemplate}">
<ItemsRepeater.Layout>
<UniformGridLayout Orientation="Horizontal" />
</ItemsRepeater.Layout>
</ItemsRepeater>
</ScrollViewer>
</Grid>
<!--#endregion-->
</Grid>
</Window>