WIn_RustTools/RustTools/Views/ModulePage.xaml

120 lines
4.8 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"
mc:Ignorable="d">
<Page.Resources>
<!-- 模组 -->
<DataTemplate x:Key="RwmodItem">
<Button
Background="{ThemeResource SystemColorWindowColor}"
Click="Button_Click_RwmodItem"
CornerRadius="9">
<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="/Assets/image/rwmod.svg" />
<Button
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="Transparent"
Click="Button_Click">
<FontIcon Glyph="&#xE712;" />
</Button>
<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>
</Button>
</DataTemplate>
<!-- 文件夹 -->
<DataTemplate x:Key="FolderItem">
2024-08-08 04:29:27 +00:00
<Button
Background="{ThemeResource SystemColorWindowColor}"
CornerRadius="9"
ToolTipService.ToolTip="{Binding Info}">
<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem Text="打开" />
2024-08-08 04:29:27 +00:00
<MenuFlyoutItem Click="ViewModel.Button_Rwmod" Text="打包" />
<MenuFlyoutItem Text="发布" />
<MenuFlyoutItem Click="Button_Delete" Text="删除" />
</MenuFlyout>
</Button.Flyout>
<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>
</Button>
</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"
IsItemClickEnabled="False"
2024-08-08 04:29:27 +00:00
ItemsSource="{x:Bind ViewModel.ListMod}"
SelectionMode="None">
<GridView.ItemTemplateSelector>
<local:MyItemTemplateSelector Template1="{StaticResource RwmodItem}" Template2="{StaticResource FolderItem}" />
</GridView.ItemTemplateSelector>
</GridView>
</Grid>
</Page>