1+ <Window x : Class =" QuickViewFile.MainWindowNoBorder"
2+ xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+ xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
4+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5+ xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
6+ xmlns : local =" clr-namespace:QuickViewFile.Controls"
7+ xmlns : helpers =" clr-namespace:QuickViewFile.Helpers"
8+ xmlns : viewmodel =" clr-namespace:QuickViewFile.ViewModel"
9+ d : DataContext =" {d:DesignInstance Type=viewmodel:FilesListViewModel}"
10+ mc : Ignorable =" d"
11+ WindowState =" Maximized"
12+ WindowStyle =" None"
13+ Background =" Transparent"
14+ AllowsTransparency =" True"
15+ WindowStartupLocation =" CenterScreen"
16+ KeyDown =" AppWindow_KeyDown"
17+ MouseLeftButtonDown =" Window_MouseLeftButtonDown"
18+ ResizeMode =" CanResize"
19+ Title =" QuickViewFile" Height =" 720" Width =" 1280" >
20+ <Window .Resources>
21+ <BooleanToVisibilityConverter x : Key =" BoolToVisibilityConverter" />
22+ <helpers : NullToVisibilityConverter x : Key =" NullToVisibilityConverter" />
23+ <helpers : NullToCollapsedConverter x : Key =" NullToCollapsedConverter" />
24+ <helpers : ScrollBarsVisibilityConverter x : Key =" ScrollBarsVisibilityConverter" />
25+ <Style TargetType =" ListViewItem" >
26+ <Setter Property =" MinHeight" Value =" 40" />
27+ </Style >
28+ </Window .Resources>
29+ <Grid Name =" MainGrid" Focusable =" False" >
30+ <Grid .RowDefinitions>
31+ <RowDefinition Height =" Auto" />
32+ <RowDefinition Height =" *" />
33+ <RowDefinition Height =" Auto" />
34+ </Grid .RowDefinitions>
35+
36+ <Grid Grid.Row=" 0" x : Name =" TopInfoPanel" >
37+ <Grid .ColumnDefinitions>
38+ <ColumnDefinition Width =" *" />
39+ <ColumnDefinition Width =" Auto" />
40+ </Grid .ColumnDefinitions>
41+
42+ <TextBlock
43+ Grid.Column=" 0"
44+ Text =" {Binding SelectedItem.FullPath}"
45+ FontWeight =" Bold"
46+ Foreground =" {DynamicResource {x:Static SystemColors.AccentColorBrushKey}}"
47+ Name =" FileFullPathTextBlock"
48+ FontSize =" 13"
49+ Margin =" 0,0,0,0"
50+ Padding =" 10,10,10,10"
51+ TextWrapping =" NoWrap" />
52+
53+ <Button
54+ Grid.Column=" 1"
55+ Content =" Save"
56+ Name =" SaveButton"
57+ Height =" 24"
58+ Margin =" 0,8,10,8"
59+ Padding =" 15,0"
60+ Click =" SaveButton_Click"
61+ Visibility =" {Binding SelectedItem.FileContentModel.ShowTextBox, Converter={StaticResource BoolToVisibilityConverter}}" />
62+ </Grid >
63+
64+ <Grid Grid.Row=" 1" Focusable =" False" >
65+ <Grid .ColumnDefinitions>
66+ <ColumnDefinition x : Name =" FilesListColumn" Width =" Auto" />
67+ <ColumnDefinition Width =" Auto" />
68+ <ColumnDefinition Width =" *" />
69+ </Grid .ColumnDefinitions>
70+ <ListView Grid.Column=" 0"
71+ x : Name =" FilesListView"
72+ Focusable =" False"
73+ IsTabStop =" False"
74+ SelectionMode =" Single"
75+ ItemsSource =" {Binding ActiveListItems}"
76+ SelectedItem =" {Binding SelectedItem}"
77+ MouseDoubleClick =" FilesListView_MouseDoubleClick"
78+ Margin =" 10"
79+ KeyDown =" FilesListView_KeyDown"
80+ ClipToBounds =" True"
81+ Width =" Auto"
82+ FocusManager.IsFocusScope=" False"
83+ ScrollViewer.PanningMode=" VerticalFirst"
84+ SelectiveScrollingGrid.SelectiveScrollingOrientation=" Vertical"
85+ IsManipulationEnabled =" True"
86+ ScrollViewer.HorizontalScrollBarVisibility=" Auto"
87+ ScrollViewer.CanContentScroll=" True" >
88+ <ListView .View>
89+ <GridView >
90+ <GridViewColumn Header =" Name" Width =" Auto" FocusManager.IsFocusScope=" False" >
91+ <GridViewColumn .CellTemplate>
92+ <DataTemplate >
93+ <TextBlock Text =" {Binding Name}"
94+ FontSize =" 13"
95+ Focusable =" False"
96+ VerticalAlignment =" Center"
97+ FontWeight =" Normal" />
98+ </DataTemplate >
99+ </GridViewColumn .CellTemplate>
100+ </GridViewColumn >
101+ <GridViewColumn Header =" Size (KB)" Width =" 80" FocusManager.IsFocusScope=" False" >
102+ <GridViewColumn .CellTemplate>
103+ <DataTemplate >
104+ <TextBlock Text =" {Binding Size}"
105+ FontSize =" 13"
106+ Focusable =" False"
107+ VerticalAlignment =" Center"
108+ FontWeight =" Normal" />
109+ </DataTemplate >
110+ </GridViewColumn .CellTemplate>
111+ </GridViewColumn >
112+ </GridView >
113+ </ListView .View>
114+ </ListView >
115+ <GridSplitter Grid.Column=" 1"
116+ Width =" 1"
117+ UseLayoutRounding =" True"
118+ Margin =" 5,5,5,5"
119+ x : Name =" MainWindowGridSplitter"
120+ Background =" {DynamicResource {x:Static SystemColors.AccentColorBrushKey}}"
121+ HorizontalContentAlignment =" Center" Focusable =" False" />
122+ <Border x : Name =" ContentBorder"
123+ Grid.Column=" 2"
124+ BorderThickness =" 1"
125+ Margin =" 1" >
126+ <Grid
127+ MouseRightButtonDown =" Grid_MouseRightButtonDown"
128+ Height =" Auto"
129+ HorizontalAlignment =" Stretch"
130+ Width =" Auto" >
131+ <Grid .RowDefinitions>
132+ <RowDefinition Height =" *" />
133+ </Grid .RowDefinitions>
134+
135+ <!-- File content: Image, Video or Text-->
136+ <Grid MouseRightButtonDown =" FileContentGrid_MouseRightButtonDown"
137+ Grid.Row=" 0"
138+ Name =" GridFileContent" ClipToBounds =" True" Grid.IsSharedSizeScope=" True" IsManipulationEnabled =" True" SnapsToDevicePixels =" True" >
139+
140+ <local : VideoPlayerControl
141+ x : Name =" VideoMedia"
142+ Content =" {Binding SelectedItem.FileContentModel.VideoMedia}"
143+ Visibility =" {Binding SelectedItem.FileContentModel.VideoMedia, Converter={StaticResource NullToCollapsedConverter}}" />
144+
145+
146+ <Grid
147+ Height =" Auto"
148+ Width =" Auto"
149+ Visibility =" {Binding SelectedItem.FileContentModel.ImageSource, Converter={StaticResource NullToCollapsedConverter}}"
150+ ClipToBounds =" True" >
151+ <local : ZoomableImage
152+ Source =" {Binding SelectedItem.FileContentModel.ImageSource}"
153+ VerticalAlignment =" Center"
154+ Stretch =" Uniform"
155+ x : Name =" ZoomableImageElement"
156+ HorizontalAlignment =" Center"
157+ RenderOptions.BitmapScalingMode=" {Binding Config.BitmapScalingMode}"
158+ Visibility =" {Binding SelectedItem.FileContentModel.ImageSource, Converter={StaticResource NullToCollapsedConverter}}"
159+ />
160+ </Grid >
161+
162+
163+ <Grid Visibility =" {Binding SelectedItem.FileContentModel.ShowTextBox, Converter={StaticResource BoolToVisibilityConverter}}" x : Name =" GridSearchBox" >
164+ <Grid .RowDefinitions>
165+ <RowDefinition Height =" Auto" />
166+ <RowDefinition Height =" *" />
167+ </Grid .RowDefinitions>
168+
169+ <!-- Search Panel -->
170+ <StackPanel Grid.Row=" 0"
171+ Orientation =" Horizontal"
172+ Margin =" 10,5,10,5" >
173+ <TextBox x : Name =" SearchTextBox"
174+ Width =" 200"
175+ Margin =" 5,0,5,0"
176+ VerticalContentAlignment =" Center"
177+ KeyDown =" SearchTextBox_KeyDown" />
178+ <Button Content =" Find Next"
179+ Height =" 24"
180+ Padding =" 10,0"
181+ Click =" FindNext_Click"
182+ Margin =" 0,0,5,0" />
183+ <Button Content =" Find Previous"
184+ Height =" 24"
185+ Padding =" 10,0"
186+ Click =" FindPrevious_Click"
187+ Margin =" 0,0,5,0" />
188+ <TextBlock x : Name =" SearchResultsCount"
189+ VerticalAlignment =" Center"
190+ Margin =" 5,0" />
191+ </StackPanel >
192+
193+ <TextBox Grid.Row=" 1"
194+ FontFamily =" Consolas"
195+ SpellCheck.IsEnabled=" False"
196+ Name =" TextBoxTextContent"
197+ HorizontalScrollBarVisibility =" Auto"
198+ VerticalScrollBarVisibility =" Auto"
199+ Margin =" 10"
200+ ClipToBounds =" True"
201+ Visibility =" {Binding SelectedItem.FileContentModel.ShowTextBox, Converter={StaticResource BoolToVisibilityConverter}}"
202+ FontSize =" {Binding Config.FontSize}"
203+ Text =" {Binding SelectedItem.FileContentModel.TextContent, Mode=TwoWay}"
204+ TextWrapping =" {Binding Config.TextPreviewWordWrap}" />
205+ </Grid >
206+ </Grid >
207+ </Grid >
208+ </Border >
209+ </Grid >
210+ <Grid Grid.Row=" 2" x : Name =" StatusBar" >
211+ <TextBlock x : Name =" StatusBarTextBlock"
212+ FontSize =" 9"
213+ VerticalAlignment =" Bottom"
214+ HorizontalAlignment =" Left"
215+ Margin =" 0,0,0,0"
216+ MouseDown =" StatusBarTextBlock_MouseDown"
217+ Foreground =" {DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"
218+ Text =" {Binding StatusBarText}" />
219+ </Grid >
220+ </Grid >
221+ </Window >
0 commit comments