WIn_RustTools/RustTools/Views/ModulePage.xaml

128 lines
5.2 KiB
Plaintext
Raw Normal View History

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