forked from crskycode/GARbro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
432 lines (426 loc) · 32.2 KB
/
MainWindow.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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<Window x:Class="GARbro.GUI.MainWindow" x:Name="AppWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GARbro.GUI"
xmlns:jv="clr-namespace:JustView"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:p="clr-namespace:GARbro.GUI.Properties"
Title="GARbro" MinHeight="250" ResizeMode="CanResizeWithGrip"
Loaded="WindowLoaded"
KeyDown="WindowKeyDown"
AllowDrop="True" Drop="OnDropEvent"
Top="{Binding Source={x:Static p:Settings.Default}, Path=winTop, Mode=TwoWay}"
Left="{Binding Source={x:Static p:Settings.Default}, Path=winLeft, Mode=TwoWay}"
Height="{Binding Source={x:Static p:Settings.Default}, Path=winHeight, Mode=TwoWay}"
Width="{Binding Source={x:Static p:Settings.Default}, Path=winWidth, Mode=TwoWay}"
WindowState="{Binding Source={x:Static p:Settings.Default}, Path=winState, Mode=TwoWay}">
<Window.Resources>
<!-- alternate colors for directory view -->
<SolidColorBrush x:Key="AlternateColor1" Color="#f2f5f9" />
<SolidColorBrush x:Key="AlternateColor2" Color="White" />
<SolidColorBrush x:Key="InactiveInputBackground" Color="#ebf5fe" />
<!-- toolbar icons -->
<BitmapImage x:Key="Icon32x32Back" UriSource="Images/32x32/back button.png"/>
<BitmapImage x:Key="Icon32x32Forward" UriSource="Images/32x32/forward button.png"/>
<BitmapImage x:Key="Icon32x32Help" UriSource="Images/32x32/help.png"/>
<BitmapImage x:Key="Icon48x48Refresh" UriSource="Images/48x48/refresh.png"/>
<!-- directory view internals -->
<CollectionViewSource x:Key="ListViewSource" Source="{Binding}"/>
<local:BooleanToCollapsedVisibilityConverter x:Key="booleanToCollapsedVisibilityConverter" />
<local:EntryTypeConverter x:Key="entryTypeConverter"/>
<local:SortModeToBooleanConverter x:Key="sortModeToBooleanConverter" />
<Style x:Key="HeaderLeftAlign" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
</Style>
<DataTemplate x:Key="SortArrowUp">
<DockPanel>
<TextBlock Margin="5,0,5,0" Text="{Binding}" />
<Path VerticalAlignment="Center" Fill="Gray" Data="M 5,5 15,5 10,0 5,5" />
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="SortArrowDown">
<DockPanel>
<TextBlock Margin="5,0,5,0" Text="{Binding}" />
<Path VerticalAlignment="Center" Fill="Gray" Data="M 5,0 10,5 15,0 5,0" />
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="SortArrowNone">
<TextBlock Margin="5,0,5,0" Text="{Binding}"/>
</DataTemplate>
<Style x:Key="DefaultMenuItemStyle" TargetType="{x:Type MenuItem}">
<Setter Property="FontWeight" Value="Bold" />
</Style>
<!-- Sort-by submenu -->
<MenuItem x:Key="sortByMenu" Header="{x:Static s:guiStrings.CtxMenuSortBy}">
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortByName}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Name}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Name"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortByType}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Type}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Type"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortBySize}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Size}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Size"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuUnsorted}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}}"
Command="{x:Static local:Commands.SortBy}"/>
</MenuItem>
<!-- Default listview context menu -->
<ContextMenu x:Key="lvDirContextMenu">
<MenuItem Header="{x:Static s:guiStrings.CtxMenuOpen}" InputGestureText="Enter"
Style="{StaticResource DefaultMenuItemStyle}"
Command="{x:Static local:Commands.OpenItem}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuCreate}" InputGestureText="F3"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.CreateArchive}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExtract}" InputGestureText="F4"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.ExtractItem}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSelectByMask}"
Command="{x:Static local:Commands.AddSelection}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuFileType}">
<MenuItem DataContext="image" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem DataContext="audio" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem DataContext="script" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem Header="{x:Static s:guiStrings.Type_NONE}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter=""/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExplorer}" InputGestureText="Ctrl+E"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.ExploreItem}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuDelete}" InputGestureText="Del"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.DeleteItem}"/>
<Separator/>
<!--
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRename}" InputGestureText="F2"
Command="{x:Static local:Commands.RenameItem}"/>
-->
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRefresh}" InputGestureText="F5"
Command="{x:Static local:Commands.Refresh}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuConvert}" InputGestureText="F6"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.ConvertMedia}" />
</ContextMenu>
</Window.Resources>
<DockPanel LastChildFill="True">
<StackPanel x:Name="MainMenuBar" DockPanel.Dock="Top" Orientation="Vertical"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winMenuBarVisibility, Mode=TwoWay}">
<Menu IsMainMenu="True" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}">
<MenuItem Header="{x:Static s:guiStrings.MenuFile}">
<MenuItem Header="{x:Static s:guiStrings.MenuOpen}" Command="{x:Static local:Commands.OpenFile}" InputGestureText="Ctrl+O"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuCreate}" InputGestureText="F3"
Command="{x:Static local:Commands.CreateArchive}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuConvert}" InputGestureText="F6"
Command="{x:Static local:Commands.ConvertMedia}" />
<MenuItem Header="{x:Static s:guiStrings.MenuRecent}" x:Name="RecentFilesMenu">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Header" Value="{Binding Path=Item2}"/>
<Setter Property="Command" Value="{x:Static local:Commands.OpenRecent}"/>
<Setter Property="CommandParameter" Value="{Binding Path=Item1}"/>
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<Separator/>
<MenuItem Header="{x:Static s:guiStrings.MenuExit}" Command="{x:Static local:Commands.Exit}" InputGestureText="Ctrl+Q"/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.MenuView}">
<MenuItem Header="{x:Static s:guiStrings.MenuPreferences}" InputGestureText="Ctrl+P"
Command="{x:Static local:Commands.Preferences}"/>
<Separator/>
<MenuItem Header="{x:Static s:guiStrings.MenuFitWindow}" InputGestureText="Ctrl+H"
Command="{x:Static local:Commands.FitWindow}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRefresh}" InputGestureText="F5"
Command="{x:Static local:Commands.Refresh}"/>
<Separator/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleToolBar}" InputGestureText="Alt+Shift+T"
Command="{x:Static local:Commands.HideToolBar}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleMenuBar}" InputGestureText="Alt+Shift+M"
Command="{x:Static local:Commands.HideMenuBar}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleStatusBar}" InputGestureText="Alt+Shift+S"
Command="{x:Static local:Commands.HideStatusBar}"/>
<Separator/>
<StaticResource ResourceKey="sortByMenu"/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.MenuHelp}">
<MenuItem Header="{x:Static s:guiStrings.MenuAbout}" Command="{x:Static local:Commands.About}"/>
<MenuItem Header="Troubleshooting..." Command="{x:Static local:Commands.TroubleShooting}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuCheckUpdates}" Command="{x:Static local:Commands.CheckUpdates}"/>
</MenuItem>
</Menu>
<Separator Height="1" Margin="0"/>
</StackPanel>
<Menu Visibility="Collapsed" x:Name="HelperMenuBar"/>
<DockPanel x:Name="MainToolBar" Background="{Binding Path=Background, ElementName=HelperMenuBar}"
HorizontalAlignment="Stretch" DockPanel.Dock="Top"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winToolBarVisibility, Mode=TwoWay}">
<DockPanel.Resources>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Margin" Value="1,2,1,2"/>
</Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Margin" Value="2,2,2,2"/>
</Style>
<Style TargetType="{x:Type Separator}" BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}">
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<!-- Path input textbox mouseover highlight -->
<Style TargetType="{x:Type local:ExtAutoCompleteBox}">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsTextBoxFocused" Value="False"/>
<Condition Property="IsMouseOver" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource InactiveInputBackground}"/>
</MultiTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Image}">
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<!--
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self}, Path=Source.Width}"/>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self}, Path=Source.Height}"/>
<Setter Property="Stretch" Value="None"/>
-->
<Setter Property="Width" Value="24"/>
<Setter Property="Height" Value="24"/>
<Setter Property="Stretch" Value="Uniform"/>
<!-- hack to make images within disabled toolbar buttons appear 'grayed out'.
This doesn't gray them at all, but lowers their opacity so the (usually gray)
background of the button shows through. If WPF had a built-in facility for
grayscaling images in disabled buttons, this kind of icky kludgery wouldn't be
necessary -->
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
<Setter Property="Opacity" Value="0.33"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Resources>
<Separator DockPanel.Dock="Bottom" Height="1" Margin="0"/>
<Button x:Name="ButtonBack" ToolTip="{x:Static s:guiStrings.TooltipBack}" Margin="5,2,0,2"
Command="{x:Static local:Commands.GoBack}">
<Image Source="{StaticResource Icon32x32Back}"/>
</Button>
<Button x:Name="ButtonForward" ToolTip="{x:Static s:guiStrings.TooltipForward}"
Command="{x:Static local:Commands.GoForward}">
<Image Source="{StaticResource Icon32x32Forward}"/>
</Button>
<Separator/>
<StackPanel Orientation="Horizontal" x:Name="PathWidget">
<local:ExtAutoCompleteBox x:Name="pathLine" Height="22" Width="100" Margin="0" BorderThickness="1,1,0,1"/>
<Button ToolTip="{x:Static s:guiStrings.CtxMenuRefresh}" Height="22" Width="22" Margin="0"
Background="{Binding ElementName=pathLine, Path=Background}"
BorderBrush="{Binding ElementName=pathLine, Path=BorderBrush}" BorderThickness="1"
Command="{x:Static local:Commands.Refresh}">
<Image Source="{StaticResource Icon48x48Refresh}" Height="16" Width="16"/>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" x:Name="EncodingWidget" Visibility="{Binding ElementName=TextView, Path=Visibility}">
<Separator/>
<TextBlock Text="{x:Static s:guiStrings.LabelEncoding}" VerticalAlignment="Center" Margin="5,0,5,0"/>
<ComboBox x:Name="EncodingChoice" IsEditable="False" Height="22" DisplayMemberPath="EncodingName"
ItemsSource="{Binding ElementName=AppWindow, Path=TextEncodings}"
SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=appTextEncoding, Mode=TwoWay}"
SelectedValuePath="CodePage" SelectionChanged="OnEncodingSelect"/>
<Separator/>
</StackPanel>
<Button ToolTip="{x:Static s:guiStrings.MenuAbout}" DockPanel.Dock="Right" Margin="0,2,10,2"
Command="{x:Static local:Commands.About}">
<Image Source="{StaticResource Icon32x32Help}"/>
</Button>
<TextBlock Visibility="Hidden"/>
</DockPanel>
<StackPanel DockPanel.Dock="Bottom" x:Name="AppStatusBar"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winStatusBarVisibility, Mode=TwoWay}">
<Separator Height="1" Margin="0"/>
<StatusBar>
<StatusBarItem Width="{Binding ElementName=CurrentDirectory, Path=ActualWidth}">
<TextBlock x:Name="appStatusText"/>
</StatusBarItem>
<Separator Width="1"/>
<StatusBarItem x:Name="appPlaybackControl" Visibility="Collapsed">
<Button Width="18" Height="18"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
Command="{x:Static local:Commands.StopPlayback}">
<Rectangle Stretch="Fill" Fill="Black" Width="8" Height="8"/>
</Button>
</StatusBarItem>
<StatusBarItem>
<TextBlock x:Name="appResourceText"/>
</StatusBarItem>
</StatusBar>
</StackPanel>
<Grid x:Name="ContentGrid" DockPanel.Dock="Left" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" ShowGridLines="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Source={x:Static p:Settings.Default}, Path=lvPanelWidth, Mode=TwoWay}" MinWidth="200" />
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="*" MinWidth="100"/>
</Grid.ColumnDefinitions>
<local:ListViewEx x:Name="CurrentDirectory" Grid.Column="0" BorderThickness="0"
ItemsSource="{Binding Source={StaticResource ListViewSource}}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
BorderBrush="Transparent" SelectedValuePath="Name"
SelectionMode="Extended" Foreground="Black" AlternationCount="2"
ContextMenu="{StaticResource lvDirContextMenu}"
PreviewTextInput="lv_TextInput" IsSynchronizedWithCurrentItem="True"
PreviewKeyDown="lv_KeyDown"
SelectionChanged="lv_SelectionChanged"
GridViewColumnHeader.Click="lv_ColumnHeaderClicked">
<ListView.Resources>
<SolidColorBrush x:Key="ItemInactiveBackground" Color="#ffcbcbcb" />
</ListView.Resources>
<ListView.InputBindings>
<KeyBinding Key="Enter" Command="{x:Static local:Commands.OpenItem}"/>
<KeyBinding Gesture="Ctrl+E" Command="{x:Static local:Commands.ExploreItem}"/>
<KeyBinding Gesture="F2" Command="{x:Static local:Commands.RenameItem}"/>
<KeyBinding Gesture="Space" Command="{x:Static local:Commands.NextItem}"/>
<KeyBinding Gesture="Ctrl+Insert" Command="{x:Static local:Commands.CopyNames}"/>
<KeyBinding Gesture="Ctrl+PageDown" Command="{x:Static local:Commands.Descend}"/>
<KeyBinding Gesture="Ctrl+PageUp" Command="{x:Static local:Commands.Ascend}"/>
<MouseBinding Gesture="LeftDoubleClick" Command="{x:Static local:Commands.OpenItem}" />
</ListView.InputBindings>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<EventSetter Event="ListViewItem.MouseDoubleClick" Handler="lvi_DoubleClick" />
<Style.Triggers>
<!-- BEGIN alternate row color -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="ItemsControl.AlternationIndex" Value="0"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource AlternateColor1}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="ItemsControl.AlternationIndex" Value="1"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource AlternateColor2}"/>
</MultiTrigger>
<!-- END alternate row color -->
<!-- BEGIN context menu trigger -->
<!--
<DataTrigger Binding="{Binding Path=IsArchive}" Value="True">
<Setter Property="ContextMenu" Value="{StaticResource lvArcContextMenu}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsArchive}" Value="False">
<Setter Property="ContextMenu" Value="{StaticResource lvDirContextMenu}"/>
</DataTrigger>
-->
<!-- END context menu trigger -->
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvNameColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Name" Content="{x:Static s:guiStrings.HeaderName}"/>
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate><TextBlock x:Name="item_Name" Text="{Binding Path=Name}"/></DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvTypeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}" DisplayMemberBinding="{Binding Path=Type, Mode=OneWay, Converter={StaticResource entryTypeConverter}}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Type" Content="{x:Static s:guiStrings.HeaderType}"/>
</GridViewColumn.Header>
</GridViewColumn>
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvSizeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Size" Content="{x:Static s:guiStrings.HeaderSize}"/>
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate><TextBlock Text="{Binding Path=Size}" TextAlignment="Right"/></DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</local:ListViewEx>
<Grid Grid.Column="2" Name="PreviewPane" SnapsToDevicePixels="True">
<ScrollViewer Name="ImageView" Background="LightGray" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
SizeChanged="PreviewSizeChanged">
<Image Name="ImageCanvas" Stretch="None" UseLayoutRounding="True" SnapsToDevicePixels="True"
local:TouchScrolling.IsEnabled="True" RenderOptions.BitmapScalingMode="NearestNeighbor"
Cursor="Images/Cursors/grab.cur" local:TouchScrolling.DraggingCursor="Images/Cursors/grabbing.cur" />
</ScrollViewer>
<jv:TextViewer x:Name="TextView" Visibility="Collapsed" BorderThickness="1,0,0,0" BorderBrush="Black"/>
</Grid>
<!-- Margin and BorderThickness help to react early on mouse pointer -->
<GridSplitter Grid.Column="1" Background="Black" ShowsPreview="False" Focusable="False"
Margin="-3,0" BorderThickness="3,0" BorderBrush="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Stretch" />
</Grid>
</DockPanel>
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+O" Command="{x:Static local:Commands.OpenFile}"/>
<KeyBinding Gesture="Ctrl+Q" Command="{x:Static local:Commands.Exit}"/>
<KeyBinding Gesture="Ctrl+H" Command="{x:Static local:Commands.FitWindow}"/>
<KeyBinding Gesture="Ctrl+A" Command="{x:Static local:Commands.SelectAll}"/>
<KeyBinding Gesture="Ctrl+P" Command="{x:Static local:Commands.Preferences}"/>
<KeyBinding Gesture="Ctrl+S" Command="{x:Static local:Commands.ScaleImage}"/>
<KeyBinding Gesture="Backspace" Command="{x:Static local:Commands.GoBack}"/>
<KeyBinding Gesture="Alt+Left" Command="{x:Static local:Commands.GoBack}"/>
<KeyBinding Gesture="Alt+Right" Command="{x:Static local:Commands.GoForward}"/>
<KeyBinding Gesture="Alt+Shift+M" Command="{x:Static local:Commands.HideMenuBar}"/>
<KeyBinding Gesture="Alt+Shift+T" Command="{x:Static local:Commands.HideToolBar}"/>
<KeyBinding Gesture="Alt+Shift+S" Command="{x:Static local:Commands.HideStatusBar}"/>
<KeyBinding Gesture="F3" Command="{x:Static local:Commands.CreateArchive}"/>
<KeyBinding Gesture="F4" Command="{x:Static local:Commands.ExtractItem}"/>
<KeyBinding Gesture="F5" Command="{x:Static local:Commands.Refresh}"/>
<KeyBinding Gesture="F6" Command="{x:Static local:Commands.ConvertMedia}"/>
<KeyBinding Gesture="Delete" Command="{x:Static local:Commands.DeleteItem}"/>
<KeyBinding Gesture="Add" Command="{x:Static local:Commands.AddSelection}"/>
<KeyBinding Gesture="Space" Command="{x:Static local:Commands.NextItem}"/>
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:Commands.OpenItem}" Executed="OpenItemExec" CanExecute="CanExecuteOnSelected"/>
<CommandBinding Command="{x:Static local:Commands.OpenFile}" Executed="OpenFileExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.OpenRecent}" Executed="OpenRecentExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.AddSelection}" Executed="AddSelectionExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.SelectAll}" Executed="SelectAllExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.CopyNames}" Executed="CopyNamesExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.NextItem}" Executed="NextItemExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.ExtractItem}" Executed="ExtractItemExec" CanExecute="CanExecuteExtract"/>
<CommandBinding Command="{x:Static local:Commands.CreateArchive}" Executed="CreateArchiveExec" CanExecute="CanExecuteCreateArchive"/>
<CommandBinding Command="{x:Static local:Commands.DeleteItem}" Executed="DeleteItemExec" CanExecute="CanExecuteOnPhysicalFile" />
<CommandBinding Command="{x:Static local:Commands.RenameItem}" Executed="RenameItemExec" CanExecute="CanExecuteInDirectory" />
<CommandBinding Command="{x:Static local:Commands.ExploreItem}" Executed="ExploreItemExec" CanExecute="CanExecuteInDirectory" />
<CommandBinding Command="{x:Static local:Commands.ConvertMedia}" Executed="ConvertMediaExec" CanExecute="CanExecuteConvertMedia" />
<CommandBinding Command="{x:Static local:Commands.SortBy}" Executed="SortByExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.SetFileType}" Executed="SetFileTypeExec" CanExecute="CanExecuteOnSelected"/>
<CommandBinding Command="{x:Static local:Commands.GoBack}" Executed="GoBackExec" CanExecute="CanExecuteGoBack"/>
<CommandBinding Command="{x:Static local:Commands.GoForward}" Executed="GoForwardExec" CanExecute="CanExecuteGoForward"/>
<CommandBinding Command="{x:Static local:Commands.Refresh}" Executed="RefreshExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.FitWindow}" Executed="FitWindowExec" CanExecute="CanExecuteFitWindow"/>
<CommandBinding Command="{x:Static local:Commands.HideStatusBar}" Executed="HideStatusBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.HideMenuBar}" Executed="HideMenuBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.HideToolBar}" Executed="HideToolBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.About}" Executed="AboutExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.CheckUpdates}" Executed="CheckUpdatesExec" CanExecute="CanExecuteUpdate"/>
<CommandBinding Command="{x:Static local:Commands.StopPlayback}" Executed="StopPlaybackExec" CanExecute="CanExecutePlaybackControl"/>
<CommandBinding Command="{x:Static local:Commands.Preferences}" Executed="PreferencesExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.ScaleImage}" Executed="ScaleImageExec" CanExecute="CanExecuteScaleImage"/>
<CommandBinding Command="{x:Static local:Commands.TroubleShooting}" Executed="TroubleShootingExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.Descend}" Executed="DescendExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.Ascend}" Executed="AscendExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.Exit}" Executed="ExitExec" CanExecute="CanExecuteAlways"/>
</Window.CommandBindings>
</Window>