-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new image viewer for screenshots #519
- Loading branch information
Showing
8 changed files
with
782 additions
and
168 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
<Page x:Class="Starward.Pages.ImageViewPage" | ||
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:lang="using:Starward.Language" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:sc="using:Starward.Controls" | ||
xmlns:sm="using:Starward.Models" | ||
x:DefaultBindMode="OneWay" | ||
Background="Transparent" | ||
KeyDown="Page_KeyDown" | ||
Loaded="Page_Loaded" | ||
mc:Ignorable="d"> | ||
|
||
|
||
<Grid Background="{ThemeResource CustomOverlayAcrylicBrush}"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="1*" /> | ||
<ColumnDefinition Width="6*" /> | ||
<ColumnDefinition Width="1*" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
|
||
<!-- 图片浏览 --> | ||
<ScrollViewer x:Name="_ScrollViewer_Image" | ||
Grid.ColumnSpan="3" | ||
DoubleTapped="_ScrollViewer_Image_DoubleTapped" | ||
HorizontalScrollBarVisibility="Hidden" | ||
HorizontalScrollMode="Enabled" | ||
IsDoubleTapEnabled="True" | ||
IsTapEnabled="True" | ||
PointerMoved="_ScrollViewer_Image_PointerMoved" | ||
PointerPressed="_ScrollViewer_Image_PointerPressed" | ||
PointerReleased="_ScrollViewer_Image_PointerReleased" | ||
PointerWheelChanged="_ScrollViewer_Image_PointerWheelChanged" | ||
Tapped="_ScrollViewer_Image_Tapped" | ||
VerticalScrollBarVisibility="Hidden" | ||
VerticalScrollMode="Enabled" | ||
ViewChanged="_ScrollViewer_Image_ViewChanged" | ||
ZoomMode="Enabled"> | ||
<sc:CachedImage x:Name="_Image" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
ImageExOpened="_Image_ImageOpened" | ||
IsDoubleTapEnabled="True" | ||
SizeChanged="_Image_SizeChanged" | ||
Source="{x:Bind CurrentImage.FullName}"> | ||
<sc:CachedImage.RotationTransition> | ||
<ScalarTransition /> | ||
</sc:CachedImage.RotationTransition> | ||
</sc:CachedImage> | ||
</ScrollViewer> | ||
|
||
|
||
<!-- 底部图片预览 --> | ||
<GridView x:Name="_GridView_ImageCollection" | ||
Grid.Column="1" | ||
Height="100" | ||
Margin="0,0,0,24" | ||
Padding="8" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Bottom" | ||
Background="{ThemeResource CustomOverlayAcrylicBrush}" | ||
CornerRadius="8" | ||
IsItemClickEnabled="True" | ||
ItemsSource="{x:Bind ImageCollection}" | ||
ScrollViewer.HorizontalScrollBarVisibility="Auto" | ||
ScrollViewer.HorizontalScrollMode="Enabled" | ||
ScrollViewer.VerticalScrollBarVisibility="Hidden" | ||
ScrollViewer.VerticalScrollMode="Disabled" | ||
SelectedItem="{x:Bind CurrentImage, Mode=TwoWay}" | ||
Shadow="{ThemeResource ThemeShadow}" | ||
Translation="0,0,16" | ||
Visibility="Collapsed"> | ||
<GridView.OpacityTransition> | ||
<ScalarTransition /> | ||
</GridView.OpacityTransition> | ||
<GridView.ItemsPanel> | ||
<ItemsPanelTemplate> | ||
<ItemsStackPanel Orientation="Horizontal" /> | ||
</ItemsPanelTemplate> | ||
</GridView.ItemsPanel> | ||
<GridView.ItemTemplate> | ||
<DataTemplate x:DataType="sm:ScreenshotItem"> | ||
<sc:CachedImage Height="80" | ||
EnableLazyLoading="True" | ||
Source="{x:Bind FullName}" /> | ||
</DataTemplate> | ||
</GridView.ItemTemplate> | ||
</GridView> | ||
|
||
|
||
<!-- 上方工具栏 --> | ||
<Border x:Name="_Border_ToolBar" | ||
Grid.ColumnSpan="3" | ||
Margin="0,48,0,0" | ||
Padding="8" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Top" | ||
Background="{ThemeResource CustomOverlayAcrylicBrush}" | ||
CornerRadius="8" | ||
Shadow="{ThemeResource ThemeShadow}" | ||
Translation="0,0,16"> | ||
<Border.OpacityTransition> | ||
<ScalarTransition /> | ||
</Border.OpacityTransition> | ||
<StackPanel Orientation="Horizontal" Spacing="4"> | ||
<!-- 缩小 --> | ||
<Button Width="36" | ||
Height="36" | ||
Command="{x:Bind ZoomOutCommand}" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{ThemeResource DateTimePickerFlyoutButtonStyle}" | ||
ToolTipService.ToolTip="{x:Bind lang:Lang.ImageViewPage_ZoomOut}" /> | ||
<!-- 缩放率 --> | ||
<TextBlock x:Name="_TextBlock_Factor" | ||
Width="40" | ||
Margin="0,0,0,2" | ||
VerticalAlignment="Center" | ||
HorizontalTextAlignment="Center" /> | ||
<!-- 放大 --> | ||
<Button Width="36" | ||
Height="36" | ||
Command="{x:Bind ZoomInCommand}" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{ThemeResource DateTimePickerFlyoutButtonStyle}" | ||
ToolTipService.ToolTip="{x:Bind lang:Lang.ImageViewPage_ZoomIn}" /> | ||
<!-- 旋转 --> | ||
<Button Width="36" | ||
Height="36" | ||
Command="{x:Bind RotateCommand}" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{ThemeResource DateTimePickerFlyoutButtonStyle}" | ||
ToolTipService.ToolTip="{x:Bind lang:Lang.ImageViewPage_Rotate}" /> | ||
<!-- 全屏 --> | ||
<Button Name="Button_FullScreen" | ||
Width="36" | ||
Height="36" | ||
Command="{x:Bind FullScreenCommand}" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{ThemeResource DateTimePickerFlyoutButtonStyle}" | ||
ToolTipService.ToolTip="{x:Bind lang:Lang.GameSettingPage_FullScreen}" /> | ||
<AppBarSeparator Padding="0" /> | ||
<!-- 复制 --> | ||
<Button x:Name="_Button_Copy" | ||
Width="36" | ||
Height="36" | ||
Command="{x:Bind CopyImageCommand}" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{ThemeResource DateTimePickerFlyoutButtonStyle}" | ||
ToolTipService.ToolTip="{x:Bind lang:Lang.Common_Copy}"> | ||
<Button.ContentTransitions> | ||
<TransitionCollection> | ||
<ContentThemeTransition /> | ||
</TransitionCollection> | ||
</Button.ContentTransitions> | ||
</Button> | ||
<!-- 打开 --> | ||
<Button Width="36" | ||
Height="36" | ||
Command="{x:Bind OpenFileCommand}" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{ThemeResource DateTimePickerFlyoutButtonStyle}" | ||
ToolTipService.ToolTip="{x:Bind lang:Lang.Common_Open}" /> | ||
<!-- 关闭 --> | ||
<Button Width="36" | ||
Height="36" | ||
Command="{x:Bind CloseCommand}" | ||
Content="" | ||
FontFamily="{ThemeResource SymbolThemeFontFamily}" | ||
Style="{ThemeResource DateTimePickerFlyoutButtonStyle}" | ||
ToolTipService.ToolTip="{x:Bind lang:Lang.DownloadGamePage_Close}" /> | ||
</StackPanel> | ||
</Border> | ||
|
||
|
||
|
||
|
||
</Grid> | ||
</Page> |
Oops, something went wrong.