forked from duchuule/vba10
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SelectROMPane.xaml
254 lines (223 loc) · 13 KB
/
SelectROMPane.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
<Page
x:Class="VBA10.SelectROMPane"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:VBA10"
xmlns:ctl="using:VBA10.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="600"
Name="page"
>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Adaptive triggers -->
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="wideView">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="1000" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="saveBtn.Width" Value="88"/>
<Setter Target="selectStateBtn.Width" Value="88"/>
<Setter Target="resetBtn.Width" Value="88"/>
<Setter Target="loadBtn.Width" Value="88"/>
<Setter Target="lastRomGrid.Height" Value="250" />
<Setter Target="txtLastROM.FontSize" Value="30" />
<Setter Target="txtLastROM.Margin" Value="16, 0, 16, 12" />
<Setter Target="imgPlay.Width" Value="90" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="mediumView">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="500" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="saveBtn.Width" Value="68"/>
<Setter Target="selectStateBtn.Width" Value="68"/>
<Setter Target="resetBtn.Width" Value="68"/>
<Setter Target="loadBtn.Width" Value="68"/>
<Setter Target="lastRomGrid.Height" Value="250" />
<Setter Target="txtLastROM.FontSize" Value="24" />
<Setter Target="txtLastROM.Margin" Value="16, 0, 16, 12" />
<Setter Target="imgPlay.Width" Value="70" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="narrowView">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="saveBtn.Width" Value="56"/>
<Setter Target="selectStateBtn.Width" Value="56"/>
<Setter Target="resetBtn.Width" Value="56"/>
<Setter Target="loadBtn.Width" Value="56"/>
<Setter Target="txtLastROM.FontSize" Value="20" />
<Setter Target="txtLastROM.Margin" Value="12, 0, 12, 8" />
<Setter Target="imgPlay.Width" Value="60" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<!--<RelativePanel >-->
<CommandBar x:Name="topbar" VerticalAlignment="Top"
HorizontalContentAlignment="Stretch"
ClosedDisplayMode="Compact">
<!--<AppBarSeparator/>-->
<AppBarButton Icon="Save" Label="**Save" x:Name="saveBtn"
Click="saveBtn_Click" IsTabStop="False"
x:Uid="Save"/>
<AppBarButton Icon="AllApps" Label="**Select State" x:Name="selectStateBtn"
Click="selectStateBtn_Click" IsTabStop="False"
x:Uid="SelectState"/>
<AppBarButton Icon="Sync" Label="**Reset" x:Name="resetBtn"
Click="resetBtn_Click" IsTabStop="False"
x:Uid="Reset"/>
<AppBarButton Icon="Undo" Label="**Load" x:Name="loadBtn"
Click="loadBtn_Click" IsTabStop="False"
x:Uid="Load"/>
<AppBarButton x:Name="spacerBtn" IsEnabled="False" Width="1000"/>
<!--<CommandBar.SecondaryCommands>
<AppBarButton Label="Menu Item 1"/>
<AppBarButton Label="Menu Item 2"/>
<AppBarButton Label="Menu Item 3"/>
</CommandBar.SecondaryCommands>-->
</CommandBar>
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
Margin="0,0,0,0"
x:Name="svContainer"
Grid.Row="1"
>
<StackPanel
>
<StackPanel.Resources>
<CollectionViewSource x:Name="cvsAllROMEntries"/>
<CollectionViewSource x:Name="cvsLastROMEntry"/>
<!--<local:IsoImageConverter x:Key="SnapshotConverter" />-->
</StackPanel.Resources>
<Button x:Name="lastRomGrid"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Tapped="lastRomImage_Tapped"
Background="Transparent"
Margin="12,12,12,0" Padding="0"
Style="{StaticResource ImageButtonStyle}"
>
<Button.Content>
<Grid>
<Image Source="{Binding Snapshot}"
Stretch="UniformToFill"
HorizontalAlignment="Center"
VerticalAlignment="Center"
x:Name="lastRomImage"
/>
<Grid>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Offset="0.6"/>
<GradientStop Color="#B2000000" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<TextBlock Text="{Binding DisplayName}"
VerticalAlignment="Bottom"
TextWrapping="Wrap" LineStackingStrategy="BaselineToBaseline"
Foreground="White"
x:Name="txtLastROM"
/>
</Grid>
<Image Source="/Assets/play.png"
Width="60"
x:Name="imgPlay"
Opacity="0.8"/>
</Grid>
</Button.Content>
</Button>
<ListBox Name="romList"
SelectionChanged="romList_SelectionChanged"
ItemsSource="{Binding Source={StaticResource cvsAllROMEntries}}"
Padding="0"
Margin="12,12,12,0"
Background="Transparent"
>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="0,12,0,12"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Height="40" x:Name="lbAllROMMainGrid"
RightTapped="lbAllROMMainGrid_RightTapped"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
>
<Image Source="{Binding Snapshot}"
Stretch="UniformToFill"
HorizontalAlignment="Center"
VerticalAlignment="Center"
/>
</Grid>
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Grid.Column="1"
Margin="4,0,0,0">
<TextBlock
Text="{Binding DisplayName}"
TextWrapping="NoWrap"
FontSize="18" />
<TextBlock
Text="{Binding FolderPath}"
FontSize="12"
/>
</StackPanel>
<Button Grid.Column="1"
HorizontalContentAlignment="Right"
VerticalContentAlignment="Bottom"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Margin="0,-12,0,-12"
Padding="0,0,0,0"
BorderThickness="0"
FontSize="24"
FontWeight="Light"
Width="40"
Height="64"
Style="{StaticResource MinimalButtonStyle}"
x:Name="ContextMenuBtn"
Click="ContextMenuBtn_Click">
<Button.Content >
<TextBlock Text="..."
Margin="0,0,4,0"/>
</Button.Content>
</Button>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button x:Name="addROMbtn"
HorizontalAlignment="Center"
x:Uid="AddROMBtn"
Content="**Add ROM"
Width="120" Height="40"
Margin="0,12,0,12"
Click="addROMbtn_Click"/>
</StackPanel>
</ScrollViewer>
<!--</RelativePanel>-->
</Grid>
</Page>