-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
143 lines (111 loc) · 8.43 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
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="ImageRate.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ImageRate"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d"
Title="ImageRate">
<Grid x:Name="RootGrid" KeyDown="MainWindow_KeyDown" AllowDrop="True" DragOver="Grid_DragOver" Drop="Grid_Drop" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<FlyoutBase.AttachedFlyout>
<MenuFlyout x:Name="ContextMenu">
<MenuFlyoutItem x:Name="ContextMenuItem_Refresh" Text="Refresh" Click="Flyout_Refresh"/>
<MenuFlyoutItem Text="Show in explorer" Click="Flyout_ShowInExplorer"/>
<MenuFlyoutItem Text="Open with..." Click="Flyout_OpenWith"/>
<MenuFlyoutSeparator/>
<MenuFlyoutSubItem Text="Sorting" x:Name="SortSubmenu">
<RadioMenuFlyoutItem Text="Name" Tag="System.FileName" Click="Flyout_SortingChanged"/>
<RadioMenuFlyoutItem Text="Date taken" Tag="System.ItemDate" Click="Flyout_SortingChanged"/>
<RadioMenuFlyoutItem Text="Rating" Tag="System.Rating" Click="Flyout_SortingChanged"/>
</MenuFlyoutSubItem>
</MenuFlyout>
</FlyoutBase.AttachedFlyout>
<ProgressRing x:Name="ProgressIndicator" IsActive="False" />
<TextBlock x:Name="Text_NothingToShow" Text="Nothing to show" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<MediaPlayerElement x:Name="VideoView" AutoPlay="True" AreTransportControlsEnabled="False">
<MediaPlayerElement.TransportControls>
<MediaTransportControls
ShowAndHideAutomatically="False"
IsFastForwardButtonVisible="False"
IsStopButtonVisible="False"
IsPlaybackRateButtonVisible="False"
IsCompact="True"
IsZoomButtonVisible="False"/>
</MediaPlayerElement.TransportControls>
</MediaPlayerElement>
<Rectangle x:Name="VideoPlaybackStartButtonBackground" Fill="{ThemeResource AcrylicBackgroundFillColorBaseBrush}" Height="40" Width="40" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="670,0,0,16" Stroke="Transparent" RadiusY="4" RadiusX="4"/>
<Button x:Name="VideoPlaybackStartButton" Width="40" Height="40" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="670,0,0,16" Padding="4" ToolTipService.ToolTip="Set playback startpoint">
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
<Button.Flyout>
<MenuFlyout x:Name="VideoPlaybackStartSelector" Opening="VideoPlaybackStartSelector_Opening">
<MenuFlyoutItem x:Name="VideoPlaybackStartSelector_Jump" Text="Jump to startpoint" Click="VideoPlaybackStartSelector_Jump_Click" Icon="Previous"/>
<MenuFlyoutItem x:Name="VideoPlaybackStartSelector_Delete" Text="Delete" Click="VideoPlaybackStartSelector_Delete_Click" Icon="Delete"/>
<MenuFlyoutItem x:Name="VideoPlaybackStartSelector_Set" Text="Set new playback start" Click="VideoPlaybackStartSelector_Set_Click" Icon="Pin"/>
</MenuFlyout>
</Button.Flyout>
</Button>
<Image x:Name="ImageView" RightTapped="Image_RightTapped" CanDrag="True" DragStarting="ImageView_DragStarting" />
<GridView x:Name="ImagesGridView" ItemsSource="{x:Bind listItemsFiltered}" IsItemClickEnabled="True" RightTapped="Image_RightTapped" ItemClick="ImagesGridView_ItemClick" ContainerContentChanging="ImageGridView_ContainerContentChanging" SelectionChanged="ImagesGridView_SelectionChanged" CanDragItems="True" SelectionMode="Extended" DragItemsStarting="ImagesGridView_DragItemsStarting" Padding="10,10,10,10" Margin="0,0,0,16">
<GridView.ItemTemplate>
<DataTemplate x:DataType="local:ImageItem">
<RelativePanel Width="200" Height="200">
<TextBlock x:Name="SourceStorage" Visibility="Collapsed" />
<Image x:Name="ItemImage"
Width="180"
Margin="10,10,10,35"
RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignBottomWithPanel="True"
ToolTipService.ToolTip="{x:Bind Name}"
Stretch="Uniform" />
<RatingControl Value="{x:Bind Rating, Mode=OneWay}" IsReadOnly="True"
RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignBottomWithPanel="True"
Visibility="{x:Bind VisibleIfFile}"/>
<TextBlock Text="{x:Bind Name}"
RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignBottomWithPanel="True"
HorizontalTextAlignment="Center"
Visibility="{x:Bind VisibleIfFolder}"
Margin="0,0,0,15"/>
</RelativePanel>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
<Button x:Name="Button_Prev" Content="<" Click="Button_Left" HorizontalAlignment="Left" Height="100" />
<Button x:Name="Button_Next" Content=">" Click="Button_Right" HorizontalAlignment="Right" Height="100" />
<InfoBar x:Name="InfoNoMoreImages" Message="Keine weiteren Bilder." />
<RelativePanel Grid.Row="1" Margin="0 16 0 0">
<Button x:Name="PickFolderButton" Style="{StaticResource AccentButtonStyle}" Content="Open folder" Click="PickFolderButton_Click" Margin="16,0,0,0" RelativePanel.AlignLeftWithPanel="True"/>
<BreadcrumbBar x:Name="BreadcrumbBar" ItemClicked="BreadcrumbBar_ItemClicked" RelativePanel.RightOf="PickFolderButton" RelativePanel.LeftOf="RatingBox" Margin="16,3,0,0"/>
<TeachingTip x:Name="RatingError" Target="{x:Bind Rating}" Title="..." />
<Viewbox x:Name="RatingBox" Height="50" RelativePanel.AlignHorizontalCenterWithPanel="True">
<RatingControl x:Name="Rating" AutomationProperties.Name="Simple RatingControl" ValueChanged="RatingControl_ValueChanged" IsClearEnabled="True" IsReadOnly="False" RelativePanel.AlignHorizontalCenterWithPanel="True"/>
</Viewbox>
<controls:Segmented x:Name="SegmentedControl" SelectionChanged="SegmentedControl_ViewModeChanged" AllowFocusOnInteraction="False" RelativePanel.LeftOf="FilterComboBox" Margin="0,0,10,0">
<controls:SegmentedItem Icon="{ui:FontIcon Glyph=}" ToolTipService.ToolTip="List (L)" />
<controls:SegmentedItem Icon="{ui:FontIcon Glyph=}" ToolTipService.ToolTip="Picture (P)" />
<!-- <controls:SegmentedItem Icon="{ui:FontIcon Glyph=}" ToolTipService.ToolTip="Fullscreen" /> -->
</controls:Segmented>
<Button RelativePanel.LeftOf="SegmentedControl" Margin="0,0,10,0" Click="FullscreenButton_Click" ToolTipService.ToolTip="Diashow mode (F11)">
<FontIcon Glyph="" />
</Button>
<ComboBox x:Name="FilterComboBox" SelectionChanged="FilterComboBox_SelectionChanged" Loaded="FilterComboBox_Loaded" Width="120" RelativePanel.LeftOf="About">
<x:String>No Filter</x:String>
<x:String>≥ 1 star</x:String>
<x:String>≥ 2 stars</x:String>
<x:String>≥ 3 stars</x:String>
<x:String>≥ 4 stars</x:String>
<x:String>= 5 stars</x:String>
</ComboBox>
<HyperlinkButton x:Name="About" Content="About this App" NavigateUri="https://github.com/fm-sys/ImageRate" Margin="10,0,16,0" RelativePanel.AlignRightWithPanel="True"/>
</RelativePanel>
</Grid>
</Window>