mirror of
https://gitee.com/wang-yin1/wpf-visual-process-framework
synced 2026-03-02 15:50:51 +08:00
434 lines
19 KiB
XML
434 lines
19 KiB
XML
<Window
|
|
x:Class="VisionFrame.Views.MainView"
|
|
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="clr-namespace:VisionFrame.Views"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
Name="win"
|
|
Title="运动视觉框架"
|
|
Width="1300"
|
|
Height="750"
|
|
FontSize="12"
|
|
FontWeight="ExtraLight"
|
|
WindowStartupLocation="CenterScreen"
|
|
mc:Ignorable="d">
|
|
<WindowChrome.WindowChrome>
|
|
<WindowChrome NonClientFrameEdges="None" UseAeroCaptionButtons="False" />
|
|
</WindowChrome.WindowChrome>
|
|
<Window.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
<GradientStop Offset="0" Color="#DCEAFC" />
|
|
<GradientStop Offset="0.5" Color="#FFFFFF" />
|
|
<GradientStop Offset="1" Color="#DCEAFC" />
|
|
</LinearGradientBrush>
|
|
</Window.Background>
|
|
<Window.Resources>
|
|
|
|
<ControlTemplate x:Key="CatalogButtonTemp" TargetType="RadioButton">
|
|
<Grid>
|
|
<Border
|
|
Name="border"
|
|
Height="40"
|
|
Margin="0,2"
|
|
Background="Transparent">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource Iconfont}"
|
|
FontSize="22"
|
|
Foreground="White"
|
|
Text="{Binding Icon}" />
|
|
</Border>
|
|
<Canvas
|
|
Name="canvas"
|
|
Width="60"
|
|
Background="Transparent"
|
|
Visibility="Collapsed">
|
|
<Polygon
|
|
Canvas.Left="50"
|
|
Canvas.Top="10"
|
|
Fill="#DD1f71e5"
|
|
Points="5 0 0 4 5 8" />
|
|
<Border
|
|
Canvas.Left="55"
|
|
Height="60"
|
|
MaxWidth="200"
|
|
Background="#DD1f71e5"
|
|
CornerRadius="5"
|
|
TextBlock.Foreground="White">
|
|
<StackPanel Margin="10,0" VerticalAlignment="Center">
|
|
<TextBlock
|
|
Margin="0,0,0,5"
|
|
FontWeight="Bold"
|
|
Text="{Binding Name}" />
|
|
<Border Height="1" Background="#3FFF" />
|
|
<TextBlock
|
|
Margin="0,5,0,0"
|
|
Foreground="#9FFF"
|
|
Text="{Binding Description}"
|
|
TextTrimming="CharacterEllipsis" />
|
|
</StackPanel>
|
|
</Border>
|
|
</Canvas>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="border" Property="Background" Value="#2FFF" />
|
|
<!--<Setter TargetName="canvas" Property="Visibility" Value="Visible"/>-->
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="canvas" Storyboard.TargetProperty="Visibility">
|
|
<DiscreteObjectKeyFrame KeyTime="0:0:0">
|
|
<DiscreteObjectKeyFrame.Value>
|
|
<Visibility>Collapsed</Visibility>
|
|
</DiscreteObjectKeyFrame.Value>
|
|
</DiscreteObjectKeyFrame>
|
|
<DiscreteObjectKeyFrame KeyTime="0:0:0.500">
|
|
<DiscreteObjectKeyFrame.Value>
|
|
<Visibility>Visible</Visibility>
|
|
</DiscreteObjectKeyFrame.Value>
|
|
</DiscreteObjectKeyFrame>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.EnterActions>
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="canvas" Storyboard.TargetProperty="Visibility">
|
|
<DiscreteObjectKeyFrame KeyTime="0:0:0">
|
|
<DiscreteObjectKeyFrame.Value>
|
|
<Visibility>Collapsed</Visibility>
|
|
</DiscreteObjectKeyFrame.Value>
|
|
</DiscreteObjectKeyFrame>
|
|
</ObjectAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</Trigger.ExitActions>
|
|
</Trigger>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="border" Property="Background" Value="#6FFF" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
<Style x:Key="ExpandedButtonStyle" TargetType="ToggleButton">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
<Border Name="border" Background="Transparent">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="border" Property="Background" Value="#1000" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Storyboard x:Key="sb_menu_retract">
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="grid_sub_menu"
|
|
Storyboard.TargetProperty="Width"
|
|
To="0"
|
|
Duration="0:0:0.3" />
|
|
</Storyboard>
|
|
<Storyboard x:Key="sb_menu_expand">
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="grid_sub_menu"
|
|
Storyboard.TargetProperty="Width"
|
|
Duration="0:0:0.3" />
|
|
</Storyboard>
|
|
</Window.Resources>
|
|
|
|
<Grid ClipToBounds="True">
|
|
<Ellipse
|
|
Width="500"
|
|
Height="500"
|
|
Margin="200,-80,0,0"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top"
|
|
Fill="{StaticResource lgb}"
|
|
Opacity="0.6" />
|
|
<Ellipse
|
|
Width="400"
|
|
Height="400"
|
|
Margin="-80,-250,0,0"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top"
|
|
Fill="{StaticResource lgb}" />
|
|
|
|
<!-- 窗口内容部分 -->
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="50" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<!-- Logo+Title -->
|
|
<StackPanel
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<!--<Image Source="../Assets/Images/Logo_64.png" Width="30"
|
|
Effect="{StaticResource dse}"
|
|
Margin="10,0"/>-->
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
Effect="{StaticResource dse}"
|
|
FontFamily="YouYuan"
|
|
FontSize="14"
|
|
Foreground="#555">
|
|
<Run Text=" " />
|
|
<Run Text=" " />
|
|
<Run Text="运动视觉流程控制系统" />
|
|
<Run
|
|
FontFamily="Microsoft YaHei"
|
|
FontSize="9"
|
|
Text="v1.0" />
|
|
</TextBlock>
|
|
</StackPanel>
|
|
|
|
<!-- Title部分控制按钮 -->
|
|
<StackPanel
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
Orientation="Horizontal">
|
|
|
|
<Button
|
|
Command="{Binding NewFlowCommand}"
|
|
Content=""
|
|
Style="{StaticResource TitleButtonStyle}" />
|
|
<Button
|
|
Command="{Binding OpenFlowCommand}"
|
|
Content=""
|
|
Style="{StaticResource TitleButtonStyle}" />
|
|
<Button
|
|
Command="{Binding SaveFlowCommand}"
|
|
Content=""
|
|
Style="{StaticResource TitleButtonStyle}" />
|
|
<Button Content="" Style="{StaticResource TitleButtonStyle}" />
|
|
<Border
|
|
Width="1"
|
|
Height="16"
|
|
Margin="5,0"
|
|
VerticalAlignment="Center"
|
|
Background="#CCC" />
|
|
<Button Content="" Style="{StaticResource TitleButtonStyle}" />
|
|
<Button Content="" Style="{StaticResource TitleButtonStyle}" />
|
|
<Border
|
|
Width="1"
|
|
Height="16"
|
|
Margin="5,0"
|
|
Background="#CCC" />
|
|
<Button Content="" Style="{StaticResource TitleButtonStyle}" />
|
|
<Button Content="" Style="{StaticResource TitleButtonStyle}" />
|
|
<Border
|
|
Width="1"
|
|
Height="16"
|
|
Margin="5,0"
|
|
Background="#CCC" />
|
|
<TextBlock
|
|
Margin="3,0"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource Iconfont}"
|
|
FontSize="18"
|
|
Foreground=" #1f71e5"
|
|
Text="" />
|
|
<TextBlock
|
|
Margin="3,0"
|
|
VerticalAlignment="Center"
|
|
Text="<未登录>" />
|
|
<Border
|
|
Width="1"
|
|
Height="16"
|
|
Margin="5,0"
|
|
Background="#CCC" />
|
|
<Button
|
|
Margin="0"
|
|
Command="{Binding MinimizeCommand}"
|
|
Content=""
|
|
FontSize="14"
|
|
Style="{StaticResource TitleButtonStyle}" />
|
|
<Button
|
|
Margin="0"
|
|
Command="{Binding MaximizeCommand}"
|
|
Content=""
|
|
FontSize="14"
|
|
Style="{StaticResource TitleButtonStyle}" />
|
|
<Button
|
|
Margin="0,0,5,0"
|
|
Click="Button_Click"
|
|
Content=""
|
|
FontSize="14"
|
|
Style="{StaticResource TitleButtonStyle}" />
|
|
</StackPanel>
|
|
|
|
<!-- 流程相关交互 -->
|
|
<Grid Grid.Row="1" Margin="10,0,10,10">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="55" />
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
<Border Background="#1f71e5" CornerRadius="10,0,0,10" />
|
|
<Border Grid.Column="1" Background="#8FFF" />
|
|
|
|
<!-- 组件类别 -->
|
|
<ItemsControl
|
|
Margin="0,8"
|
|
Panel.ZIndex="10"
|
|
ItemsSource="{Binding CatalogList}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<RadioButton
|
|
Command="{Binding DataContext.CatalogItemCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
|
CommandParameter="{Binding}"
|
|
GroupName="A"
|
|
IsChecked="{Binding IsSelected}"
|
|
Template="{StaticResource CatalogButtonTemp}" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<!-- 组件列表 -->
|
|
<Grid
|
|
Name="grid_sub_menu"
|
|
Grid.Column="1"
|
|
Width="150">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Border
|
|
Height="1"
|
|
VerticalAlignment="Bottom"
|
|
Background="#1000" />
|
|
|
|
<TextBlock
|
|
Margin="5,0"
|
|
VerticalAlignment="Center"
|
|
FontWeight="Bold"
|
|
Foreground="#666"
|
|
Text="{Binding CurrentCatalog.Name}" />
|
|
|
|
<ItemsControl
|
|
Grid.Row="1"
|
|
VerticalAlignment="Top"
|
|
ItemsSource="{Binding CurrentCatalog.Components}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<UniformGrid Columns="2" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border
|
|
Name="border"
|
|
Width="55"
|
|
Margin="0,5"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Background="Transparent"
|
|
CornerRadius="5">
|
|
<Border.InputBindings>
|
|
<MouseBinding
|
|
Command="{Binding DataContext.ComponentItemCommand, ElementName=win}"
|
|
CommandParameter="{Binding ElementName=border}"
|
|
MouseAction="LeftClick" />
|
|
</Border.InputBindings>
|
|
<StackPanel Margin="0,5">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
FontFamily="{StaticResource Iconfont}"
|
|
FontSize="30"
|
|
Foreground="#771f71e5"
|
|
Text="{Binding Icon}" />
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
FontSize="10"
|
|
Foreground="#C000"
|
|
Text="{Binding Name}" />
|
|
</StackPanel>
|
|
</Border>
|
|
<DataTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="border" Property="Background" Value="#1000" />
|
|
</Trigger>
|
|
</DataTemplate.Triggers>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- 流程页 -->
|
|
<TabControl
|
|
Grid.Column="2"
|
|
Margin="3,0,0,0"
|
|
Background="Transparent"
|
|
BorderBrush="#1f71e5"
|
|
BorderThickness="0,1,0,0"
|
|
ItemsSource="{Binding FlowTabList}"
|
|
SelectedIndex="0"
|
|
Style="{DynamicResource TabControlStyle}">
|
|
<TabControl.ItemContainerStyle>
|
|
<Style BasedOn="{StaticResource FlowTabStyle}" TargetType="TabItem">
|
|
<Setter Property="Header" Value="{Binding Title}" />
|
|
<Setter Property="IsSelected" Value="{Binding IsCurrent}" />
|
|
</Style>
|
|
</TabControl.ItemContainerStyle>
|
|
<TabControl.ContentTemplate>
|
|
<DataTemplate>
|
|
<local:FlowTabView />
|
|
</DataTemplate>
|
|
</TabControl.ContentTemplate>
|
|
</TabControl>
|
|
|
|
|
|
<ToggleButton
|
|
Name="tb_menu_switch"
|
|
Grid.Column="2"
|
|
Width="35"
|
|
Height="35"
|
|
Margin="5,0,0,0"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
IsChecked="False"
|
|
IsThreeState="False"
|
|
Style="{StaticResource ExpandedButtonStyle}"
|
|
ToolTip="展开/收缩菜单"
|
|
WindowChrome.IsHitTestVisibleInChrome="True">
|
|
<ToggleButton.Triggers>
|
|
<EventTrigger RoutedEvent="ToggleButton.Checked">
|
|
<BeginStoryboard Storyboard="{StaticResource sb_menu_retract}" />
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="ToggleButton.Unchecked">
|
|
<BeginStoryboard Storyboard="{StaticResource sb_menu_expand}" />
|
|
</EventTrigger>
|
|
</ToggleButton.Triggers>
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontFamily="{StaticResource Iconfonts}"
|
|
FontSize="16"
|
|
Foreground="Orange"
|
|
RenderTransformOrigin="0.5,0.5"
|
|
Text="">
|
|
<TextBlock.RenderTransform>
|
|
<RotateTransform Angle="90" />
|
|
</TextBlock.RenderTransform>
|
|
</TextBlock>
|
|
</ToggleButton>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|