2024-03-11 05:12:02 +00:00
|
|
|
<UserControl x:Class="InSituLaboratory.Views.Pages.MenuManagementView"
|
|
|
|
|
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:InSituLaboratory.Views.Pages"
|
|
|
|
|
mc:Ignorable="d" Template="{StaticResource PageTempalte}"
|
2024-04-10 09:50:54 +00:00
|
|
|
FontFamily="{StaticResource DigitalDisplay}"
|
2024-03-11 05:12:02 +00:00
|
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
2024-08-22 08:01:33 +00:00
|
|
|
<UserControl.Resources>
|
|
|
|
|
<Style TargetType="GroupBox">
|
|
|
|
|
<Setter Property="Margin" Value="10,5" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="GroupBox">
|
|
|
|
|
<Grid>
|
|
|
|
|
<!-- 左上角 -->
|
|
|
|
|
<Polyline HorizontalAlignment="Left" VerticalAlignment="Top" Points="0 30, 0 10, 10 0, 30 0" Stroke="#9918AABD" StrokeThickness="1" />
|
|
|
|
|
<!-- 左上角点 -->
|
|
|
|
|
<Ellipse Width="4" Height="4" Margin="24,-2,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="#9918AABD" />
|
|
|
|
|
<Ellipse Width="4" Height="4" Margin="-2,24,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="#9918AABD" />
|
|
|
|
|
<!-- 右上角 -->
|
|
|
|
|
<Path HorizontalAlignment="Right" VerticalAlignment="Top" Data="M0 0, 3 3, 30 3, 33 0, 68 0, 73 7,78 7, 78 10M8 0, 25 0" Stroke="#5518AABD" />
|
|
|
|
|
<!-- 左下角 -->
|
|
|
|
|
<Polyline HorizontalAlignment="Left" VerticalAlignment="Bottom" Points="0,0 0,15 10,15" Stroke="#5518AABD" />
|
|
|
|
|
<!-- 右下角 -->
|
|
|
|
|
<Polyline HorizontalAlignment="Right" VerticalAlignment="Bottom" Points="10,0 0,10" Stroke="#5518AABD" />
|
|
|
|
|
<!-- 右下角图标 -->
|
|
|
|
|
<Polygon HorizontalAlignment="Right" VerticalAlignment="Bottom" Fill="#9918AABD" Points="0,7 7 7 7 0" />
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<Border Margin="30,-0.5,78,0" VerticalAlignment="Top" BorderBrush="#5518AABD" BorderThickness="0,1,0,0" />
|
|
|
|
|
<Border Margin="0,10" HorizontalAlignment="Right" BorderBrush="#5518AABD" BorderThickness="0,0,1,0" />
|
|
|
|
|
<Border Margin="10,0" VerticalAlignment="Bottom" BorderBrush="#5518AABD" BorderThickness="0,1,0,0" />
|
|
|
|
|
<Border Margin="-0.5,15" HorizontalAlignment="Left" BorderBrush="#5518AABD" BorderThickness="0,0,1,0" />
|
|
|
|
|
|
|
|
|
|
<!-- 箭头 -->
|
|
|
|
|
<Path Margin="10,13" HorizontalAlignment="Left" VerticalAlignment="Top" Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#9918AABD" />
|
|
|
|
|
<Path Margin="16,13" HorizontalAlignment="Left" VerticalAlignment="Top" Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#5518AABD" />
|
|
|
|
|
<!-- 字体 -->
|
|
|
|
|
<TextBlock Margin="25,8" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="#18AABD" Text="{TemplateBinding Header}" FontSize="18"/>
|
|
|
|
|
<!-- 占位对象 -->
|
|
|
|
|
<ContentPresenter />
|
|
|
|
|
</Grid>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
|
|
|
|
|
<Border CornerRadius="5" Background="#14273a" Margin="10,5,10,10">
|
|
|
|
|
<GroupBox>
|
|
|
|
|
<Grid Grid.IsSharedSizeScope="True" Margin="10,5,10,10">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="30"/>
|
|
|
|
|
<RowDefinition/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<Border Background="#F7F9FA" Height="1" VerticalAlignment="Bottom"/>
|
|
|
|
|
<Grid TextBlock.FontSize="15" TextBlock.FontWeight="Bold" TextBlock.Foreground="White" Background="#14273a">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="2*"/>
|
|
|
|
|
<ColumnDefinition Width="*" SharedSizeGroup="column1"/>
|
|
|
|
|
<ColumnDefinition Width="150"/>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock Text="菜单名称" VerticalAlignment="Center" Grid.Column="1"/>
|
|
|
|
|
<TextBlock Text="目标视图" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="2"/>
|
|
|
|
|
<TextBlock Text="图标" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="3"/>
|
|
|
|
|
<TextBlock Text="操作" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="4"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
<TreeView Grid.Row="1" ItemsSource="{Binding Menus}" BorderThickness="0"
|
2024-07-09 06:01:02 +00:00
|
|
|
Background="#14273a">
|
2024-08-22 08:01:33 +00:00
|
|
|
<TreeView.Resources>
|
|
|
|
|
<Style TargetType="TreeViewItem">
|
|
|
|
|
<Setter Property="IsExpanded" Value="{Binding IsExpanded,Mode=TwoWay}"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="TreeViewItem">
|
|
|
|
|
<Grid Background="Transparent" Name="root" AllowDrop="True">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition/>
|
|
|
|
|
<ColumnDefinition MaxWidth="30"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto" MinHeight="33"/>
|
|
|
|
|
<RowDefinition Height="auto"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<Border Height="1" BorderThickness="0,0,0,1" BorderBrush="LightGray"
|
2024-03-11 05:12:02 +00:00
|
|
|
HorizontalAlignment="Left" Width="20" VerticalAlignment="Center"
|
|
|
|
|
Name="borH"/>
|
2024-08-22 08:01:33 +00:00
|
|
|
<Grid HorizontalAlignment="Left" Name="canvas" Grid.RowSpan="2">
|
|
|
|
|
<Border Width="1" BorderBrush="LightGray" BorderThickness="1,0,0,0"
|
2024-03-11 05:12:02 +00:00
|
|
|
HorizontalAlignment="Left" Name="borV" />
|
2024-08-22 08:01:33 +00:00
|
|
|
</Grid>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<Border Grid.ColumnSpan="2" Name="border" Background="Transparent">
|
|
|
|
|
<Border.Triggers>
|
|
|
|
|
<EventTrigger RoutedEvent="MouseEnter">
|
|
|
|
|
<BeginStoryboard>
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
|
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0:0:0">
|
|
|
|
|
<DiscreteObjectKeyFrame.Value>
|
|
|
|
|
<Color>#09000000</Color>
|
|
|
|
|
</DiscreteObjectKeyFrame.Value>
|
|
|
|
|
</DiscreteObjectKeyFrame>
|
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
|
</Storyboard>
|
|
|
|
|
</BeginStoryboard>
|
|
|
|
|
</EventTrigger>
|
|
|
|
|
<EventTrigger RoutedEvent="MouseLeave">
|
|
|
|
|
<BeginStoryboard>
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
|
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0:0:0">
|
|
|
|
|
<DiscreteObjectKeyFrame.Value>
|
|
|
|
|
<Color>Transparent</Color>
|
|
|
|
|
</DiscreteObjectKeyFrame.Value>
|
|
|
|
|
</DiscreteObjectKeyFrame>
|
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
|
</Storyboard>
|
|
|
|
|
</BeginStoryboard>
|
|
|
|
|
</EventTrigger>
|
|
|
|
|
</Border.Triggers>
|
|
|
|
|
<Border Name="header_background">
|
|
|
|
|
<ContentPresenter x:Name="PART_Header" ContentSource="Header"/>
|
|
|
|
|
</Border>
|
|
|
|
|
</Border>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Grid.ColumnSpan="2"
|
2024-03-11 05:12:02 +00:00
|
|
|
Margin="20,0,0,0"/>
|
2024-08-22 08:01:33 +00:00
|
|
|
</Grid>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<DataTrigger Binding="{Binding ParentId}" Value="0">
|
|
|
|
|
<Setter TargetName="borH" Property="Visibility" Value="Collapsed"/>
|
|
|
|
|
<Setter TargetName="borV" Property="Visibility" Value="Collapsed"/>
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<DataTrigger Binding="{Binding IsLastChild}" Value="True">
|
|
|
|
|
<Setter TargetName="borV" Property="Margin" Value="0,0,0,17"/>
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
<Trigger Property="IsExpanded" Value="False">
|
|
|
|
|
<Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed"/>
|
|
|
|
|
</Trigger>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<!--<Trigger Property="IsMouseOver" Value="True">
|
2024-03-11 05:12:02 +00:00
|
|
|
<Setter TargetName="border" Property="Background" Value="#1000"/>
|
|
|
|
|
</Trigger>-->
|
2024-08-22 08:01:33 +00:00
|
|
|
<Trigger Property="IsSelected" Value="True">
|
|
|
|
|
<Setter TargetName="header_background" Property="Background" Value="#11409EFE">
|
|
|
|
|
</Setter>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<ControlTemplate TargetType="ToggleButton" x:Key="ExpandeButtonTemplate">
|
|
|
|
|
<Border Background="#409EFE" CornerRadius="3" Width="15" Height="15">
|
|
|
|
|
<Path Data="M0 4 8 4M4 0 4 8" Stroke="White" StrokeThickness="1" Name="path"
|
2024-03-11 05:12:02 +00:00
|
|
|
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
2024-08-22 08:01:33 +00:00
|
|
|
</Border>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsChecked" Value="True">
|
|
|
|
|
<Setter Property="Data" Value="M0 0 8 0" TargetName="path"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</TreeView.Resources>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<TreeView.ItemTemplate>
|
|
|
|
|
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
|
|
|
|
<Grid Name="root" Background="Transparent">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="30"/>
|
|
|
|
|
<ColumnDefinition Width="2*"/>
|
|
|
|
|
<ColumnDefinition Width="*" SharedSizeGroup="column1"/>
|
|
|
|
|
<ColumnDefinition Width="150"/>
|
|
|
|
|
<ColumnDefinition Width="100"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<ToggleButton IsChecked="{Binding IsExpanded}"
|
2024-03-11 05:12:02 +00:00
|
|
|
Name="expandBox" Width="15" Height="15"
|
|
|
|
|
Template="{StaticResource ExpandeButtonTemplate}"/>
|
|
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<TextBlock Text="{Binding MenuHeader}" VerticalAlignment="Center" Grid.Column="1" FontSize="15" Foreground="white"/>
|
|
|
|
|
<TextBlock Text="{Binding TargetView}" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="15"
|
2024-07-09 06:01:02 +00:00
|
|
|
Grid.Column="2" Foreground="white"/>
|
2024-08-22 08:01:33 +00:00
|
|
|
<TextBlock Text="{Binding MenuIcon}" VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
|
|
|
Grid.Column="3" FontFamily="{StaticResource Icons}" FontSize="16" Foreground="white"/>
|
2024-03-11 05:12:02 +00:00
|
|
|
|
2024-08-22 08:01:33 +00:00
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"
|
2024-03-11 05:12:02 +00:00
|
|
|
HorizontalAlignment="Center" Grid.Column="4"
|
|
|
|
|
Name="operationPanel">
|
2024-08-22 08:01:33 +00:00
|
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,3,0" >
|
2024-04-30 00:57:08 +00:00
|
|
|
<Hyperlink Command="{Binding DataContext.ModifyCommand,RelativeSource={RelativeSource AncestorType=UserControl}}" FontSize="15"
|
2024-07-09 06:01:02 +00:00
|
|
|
CommandParameter="{Binding}" Foreground="#E0FFFF">编辑</Hyperlink>
|
2024-08-22 08:01:33 +00:00
|
|
|
</TextBlock>
|
|
|
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3,0,0,0">
|
2024-04-30 00:57:08 +00:00
|
|
|
<Hyperlink Command="{Binding DataContext.DeleteCommand,RelativeSource={RelativeSource AncestorType=UserControl}}" FontSize="15"
|
2024-07-09 06:01:02 +00:00
|
|
|
CommandParameter="{Binding}" Foreground="#E0FFFF">删除</Hyperlink>
|
2024-08-22 08:01:33 +00:00
|
|
|
</TextBlock>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<HierarchicalDataTemplate.Triggers>
|
|
|
|
|
<DataTrigger Binding="{Binding Children.Count}" Value="0">
|
|
|
|
|
<Setter TargetName="expandBox" Property="Visibility" Value="Collapsed"/>
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
</HierarchicalDataTemplate.Triggers>
|
|
|
|
|
</HierarchicalDataTemplate>
|
|
|
|
|
</TreeView.ItemTemplate>
|
|
|
|
|
</TreeView>
|
|
|
|
|
</Grid>
|
|
|
|
|
</GroupBox>
|
|
|
|
|
</Border>
|
2024-03-11 05:12:02 +00:00
|
|
|
</UserControl>
|