WIn_RustTools/RustTools/Views/ModulePage.xaml
2024-08-31 18:32:38 +08:00

128 lines
5.2 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<Page
x:Class="RustTools.Views.ModulePage"
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:local="using:RustTools.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:themes="using:RustTools.Themes"
d:DataContext="{d:DesignInstance Type=local:ModulePage}"
mc:Ignorable="d">
<Page.Resources>
<!-- 模组 -->
<DataTemplate x:Key="RwmodItem">
<Grid Background="{ThemeResource SystemColorWindowColor}" CornerRadius="9">
<Grid
Width="130"
Height="160"
Padding="9,0,9,9">
<Image
Width="50"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Source="/Assets/image/rwmod.svg" />
<themes:ButtonIcon
HorizontalAlignment="Right"
VerticalAlignment="Top"
Click="Button_Click"
Glyph="&#xE712;" />
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom">
<TextBlock
HorizontalAlignment="Center"
Style="{StaticResource BodyTextBlockStyle}"
Text="{Binding Name}"
TextWrapping="NoWrap" />
<TextBlock
HorizontalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Info}"
TextWrapping="NoWrap" />
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
<!-- 文件夹 -->
<DataTemplate x:Key="FolderItem">
<Grid
Background="{ThemeResource SystemColorWindowColor}"
CornerRadius="9"
ToolTipService.ToolTip="{Binding Info}">
<Grid.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem
IsEnabled="False"
Text="打开"
ToolTipService.ToolTip="制作中···" />
<MenuFlyoutItem Click="Button_Rwmod" Text="打包" />
<MenuFlyoutItem Click="Button_PostRwmod" Text="发布" />
<MenuFlyoutItem Click="Button_Delete" Text="删除" />
</MenuFlyout>
</Grid.ContextFlyout>
<Grid
Width="130"
Height="160"
Padding="9">
<Image
Width="50"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Source="{Binding Icon}" />
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom">
<TextBlock
HorizontalAlignment="Center"
Style="{StaticResource BodyTextBlockStyle}"
Text="{Binding Name}"
TextWrapping="NoWrap" />
<TextBlock
HorizontalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Info}"
TextWrapping="NoWrap" />
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
<CommandBarFlyout x:Name="CommandBarFlyout1" Placement="Right">
<AppBarButton
Icon="Share"
Label="分享"
ToolTipService.ToolTip="分享" />
<AppBarButton
Click="Button_Delete"
Icon="Delete"
Label="删除"
ToolTipService.ToolTip="删除" />
<CommandBarFlyout.SecondaryCommands>
<AppBarButton Label="重命名" />
</CommandBarFlyout.SecondaryCommands>
</CommandBarFlyout>
</Page.Resources>
<Grid Margin="16">
<GridView
x:Name="BasicGridView"
AllowDrop="True"
CanReorderItems="True"
DoubleTapped="BasicGridView_DoubleTapped"
IsItemClickEnabled="True"
ItemsSource="{x:Bind ViewModel.ListMod}"
SelectionMode="Single">
<GridView.ItemTemplateSelector>
<local:MyItemTemplateSelector Template1="{StaticResource RwmodItem}" Template2="{StaticResource FolderItem}" />
</GridView.ItemTemplateSelector>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="Margin" Value="6" />
</Style>
</GridView.ItemContainerStyle>
</GridView>
</Grid>
</Page>