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