You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
6.7 KiB
97 lines
6.7 KiB
<Border x:Class="SparkClient.Views.Grading.DiamondSelect" |
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
xmlns:local="clr-namespace:SparkClient.Views.Grading" |
|
xmlns:hc="https://handyorg.github.io/handycontrol" |
|
d:DesignWidth="1000" |
|
d:DesignHeight="600" |
|
mc:Ignorable="d"> |
|
<Border.Resources> |
|
<BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/> |
|
</Border.Resources> |
|
<Grid> |
|
<Grid.ColumnDefinitions> |
|
<ColumnDefinition MinWidth="300" Width="1*" /> |
|
<ColumnDefinition Width="Auto" /> |
|
<ColumnDefinition MinWidth="300" Width="5*" /> |
|
</Grid.ColumnDefinitions> |
|
<TextBlock Text="{Binding Type}" Visibility="Hidden" Name="Type"/> |
|
<ScrollViewer Grid.Column="0" Background="#F7F7F7" Opacity="0.9"> |
|
<ItemsControl ItemsSource="{Binding Buttons}"> |
|
<ItemsControl.ItemsPanel> |
|
<ItemsPanelTemplate> |
|
<WrapPanel/> |
|
</ItemsPanelTemplate> |
|
</ItemsControl.ItemsPanel> |
|
<ItemsControl.ItemTemplate> |
|
<DataTemplate> |
|
<Button Background="Transparent" Command="{Binding Command}" CommandParameter="{Binding Type}" BorderBrush="Transparent" Width="130" Height="130" IsEnabled="{Binding IsEnabled}"> |
|
<Border Background="#BEB6BA" Width="110" Height="110" CornerRadius="10" Margin="5"> |
|
<Grid> |
|
<Grid.RowDefinitions> |
|
<RowDefinition Height="84"/> |
|
<RowDefinition Height="36"/> |
|
</Grid.RowDefinitions> |
|
<Image Source="{Binding ImageSource}" Grid.Row="0" Width="102" Height="84" Margin="5 5 5 0"/> |
|
<TextBlock Text="{Binding Text}" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="14" FontStyle="Normal" FontFamily="PingFangSC-regular" Foreground="#FDFEFD" Margin="5" /> |
|
<Border Background="#79410E" Grid.Row="1" Opacity="0.45" CornerRadius="0 0 10 10" Height="25" VerticalAlignment="Top" Visibility="{Binding IsHighlighted, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Visible}"> |
|
<TextBlock Text="{Binding Text}" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="14" FontStyle="Normal" FontFamily="PingFangSC-regular" Foreground="#FDFEFD" Margin="5" /> |
|
</Border> |
|
</Grid> |
|
</Border> |
|
</Button> |
|
</DataTemplate> |
|
</ItemsControl.ItemTemplate> |
|
</ItemsControl> |
|
</ScrollViewer> |
|
<Border Grid.Column="2" Background="#F7F7F7" Opacity="0.9"> |
|
<ItemsControl ItemsSource="{Binding Buttons2}"> |
|
<ItemsControl.ItemsPanel> |
|
<ItemsPanelTemplate> |
|
<WrapPanel/> |
|
</ItemsPanelTemplate> |
|
</ItemsControl.ItemsPanel> |
|
<ItemsControl.ItemTemplate> |
|
<DataTemplate> |
|
<Button Background="Transparent" Command="{Binding Command}" CommandParameter="{Binding Type}" BorderBrush="Transparent" Width="212" Height="130"> |
|
<Button.Style> |
|
<Style TargetType="Button"> |
|
<Setter Property="Template"> |
|
<Setter.Value> |
|
<ControlTemplate TargetType="Button"> |
|
<Grid> |
|
<!-- 按钮内容 --> |
|
<Border Background="#BEB6BA" Width="190" Height="110" CornerRadius="10" Margin="5"> |
|
<Grid> |
|
<Grid.RowDefinitions> |
|
<RowDefinition Height="84"/> |
|
<RowDefinition Height="36"/> |
|
</Grid.RowDefinitions> |
|
<Image Source="{Binding ImageSource}" Grid.Row="0" Width="180" Height="84" Margin="5"/> |
|
<TextBlock Text="{Binding Text}" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="14" FontStyle="Normal" FontFamily="PingFangSC-regular" Foreground="#FDFEFD"/> |
|
</Grid> |
|
</Border> |
|
<!-- 遮罩层 --> |
|
<Border Name="Overlay" Background="#9C7C5E" Opacity="0.8" Width="190" Height="110" CornerRadius="10" Margin="5" Visibility="Collapsed"> |
|
<TextBlock Text="开始检测" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" FontStyle="Normal" FontFamily="PingFangSC-regular" Foreground="#FFFFFF"/> |
|
</Border> |
|
</Grid> |
|
<ControlTemplate.Triggers> |
|
<Trigger Property="IsMouseOver" Value="True"> |
|
<Setter TargetName="Overlay" Property="Visibility" Value="Visible"/> |
|
</Trigger> |
|
</ControlTemplate.Triggers> |
|
</ControlTemplate> |
|
</Setter.Value> |
|
</Setter> |
|
</Style> |
|
</Button.Style> |
|
</Button> |
|
</DataTemplate> |
|
</ItemsControl.ItemTemplate> |
|
</ItemsControl> |
|
</Border> |
|
</Grid> |
|
</Border>
|
|
|