瀏覽代碼

优化UI框架,优化IO功能

lixiang 2 年之前
父節點
當前提交
d20db05184
共有 25 個文件被更改,包括 523 次插入77 次删除
  1. 二進制
      Venus/Framework/Output/MECF.Framework/MECF.Framework.Common.dll
  2. 二進制
      Venus/Framework/Output/MECF.Framework/MECF.Framework.Common.pdb
  3. 二進制
      Venus/Framework/Output/MECF.Framework/MECF.Framework.RT.Core.dll
  4. 二進制
      Venus/Framework/Output/MECF.Framework/MECF.Framework.RT.Core.pdb
  5. 二進制
      Venus/Framework/Output/MECF.Framework/MECF.Framework.UI.Core.dll
  6. 二進制
      Venus/Framework/Output/MECF.Framework/MECF.Framework.UI.Core.pdb
  7. 二進制
      Venus/Framework/Output/MECF.Framework/en-US/MECF.Framework.Common.resources.dll
  8. 二進制
      Venus/Framework/Output/MECF.Framework/zh-CN/MECF.Framework.Common.resources.dll
  9. 14 15
      Venus/Framework/UICore/Control/FlowPipeV2.xaml
  10. 18 18
      Venus/Framework/UICore/Control/FlowPipeV2.xaml.cs
  11. 0 7
      Venus/Framework/UICore/UICore.csproj
  12. 18 14
      Venus/Venus_MainPages/Views/OverView.xaml
  13. 33 17
      Venus/Venus_MainPages/Views/OverView.xaml.cs
  14. 25 0
      Venus/Venus_Themes/Converters/BoolToReverse.cs
  15. 25 0
      Venus/Venus_Themes/Converters/BoolToVisibility.cs
  16. 21 0
      Venus/Venus_Themes/Converters/IntPlusConverter.cs
  17. 64 0
      Venus/Venus_Themes/UserControls/FlowPipe.xaml
  18. 60 0
      Venus/Venus_Themes/UserControls/FlowPipe.xaml.cs
  19. 47 0
      Venus/Venus_Themes/UserControls/FlowPipeValve.xaml
  20. 1 1
      Venus/Framework/UICore/Control/FlowPipeValve.xaml.cs
  21. 54 0
      Venus/Venus_Themes/UserControls/Pipe.xaml
  22. 70 0
      Venus/Venus_Themes/UserControls/Pipe.xaml.cs
  23. 5 5
      Venus/Framework/UICore/Control/FlowPipeValve.xaml
  24. 51 0
      Venus/Venus_Themes/UserControls/PipeValve.xaml.cs
  25. 17 0
      Venus/Venus_Themes/Venus_Themes.csproj

二進制
Venus/Framework/Output/MECF.Framework/MECF.Framework.Common.dll


二進制
Venus/Framework/Output/MECF.Framework/MECF.Framework.Common.pdb


二進制
Venus/Framework/Output/MECF.Framework/MECF.Framework.RT.Core.dll


二進制
Venus/Framework/Output/MECF.Framework/MECF.Framework.RT.Core.pdb


二進制
Venus/Framework/Output/MECF.Framework/MECF.Framework.UI.Core.dll


二進制
Venus/Framework/Output/MECF.Framework/MECF.Framework.UI.Core.pdb


二進制
Venus/Framework/Output/MECF.Framework/en-US/MECF.Framework.Common.resources.dll


二進制
Venus/Framework/Output/MECF.Framework/zh-CN/MECF.Framework.Common.resources.dll


+ 14 - 15
Venus/Framework/UICore/Control/FlowPipeV2.xaml

@@ -7,7 +7,7 @@
     <UserControl.RenderTransform>
         <RotateTransform Angle="0" x:Name="rotateTransform"/>
     </UserControl.RenderTransform>
-        <Canvas MinHeight="4" MinWidth="100">
+    <Canvas MinHeight="4" MinWidth="100">
         <Canvas.Resources>
             <Style x:Key="AnimatingFlow" TargetType="{x:Type Path}">
                 <Style.Triggers>
@@ -78,25 +78,13 @@
                             </BeginStoryboard>
                             <StopStoryboard BeginStoryboardName="ReverseFlowStoryboard" />
                         </MultiDataTrigger.ExitActions>
-                    </MultiDataTrigger>                
+                    </MultiDataTrigger>
                 </Style.Triggers>
             </Style>
         </Canvas.Resources>
-
-
-        <Border   x:Name="border1"    CornerRadius="1"  BorderBrush="Gray"  BorderThickness="1" 
-                  Width="{Binding ElementName=flowPipeControl,Path=Width}" Height="{Binding ElementName=flowPipeControl,Path=Height}">
-            <Border.Background>
-                <LinearGradientBrush StartPoint="0.5 0" EndPoint="0.5 1">
-                    <GradientStop Color="Silver" Offset="0"/>
-                    <GradientStop Color="White" Offset="0.5"/>
-                    <GradientStop Color="Silver" Offset="1"/>
-                </LinearGradientBrush>
-            </Border.Background>
-        </Border>
         <Path Name="path1" Fill="Red" Stretch="Fill" 
               Width="{Binding ElementName=flowPipeControl,Path=Width}" 
-              Height="{Binding ElementName=border1,Path=Height}" 
+              Height="{Binding ElementName=flowPipeControl,Path=Height}" 
               Stroke="Green" StrokeDashArray="1,3" StrokeDashCap="Round" StrokeThickness="5"
               Style="{StaticResource AnimatingFlow}">
             <Path.Data>
@@ -113,5 +101,16 @@
                 </PathGeometry>
             </Path.Data>
         </Path>
+
+        <Border   x:Name="border1"    CornerRadius="1"  BorderBrush="Gray"  BorderThickness="1" Opacity="0.5" 
+                  Width="{Binding ElementName=flowPipeControl,Path=Width}" Height="{Binding ElementName=flowPipeControl,Path=Height}">
+            <Border.Background>
+                <LinearGradientBrush StartPoint="0.5 0" EndPoint="0.5 1">
+                    <GradientStop Color="Gray" Offset="0"/>
+                    <GradientStop Color="White" Offset="0.5"/>
+                    <GradientStop Color="Gray" Offset="1"/>
+                </LinearGradientBrush>
+            </Border.Background>
+        </Border>
     </Canvas>
 </UserControl>

+ 18 - 18
Venus/Framework/UICore/Control/FlowPipeV2.xaml.cs

@@ -30,15 +30,15 @@ namespace Aitex.Core.UI.Control
         }
 
         public static readonly DependencyProperty IsFlowingProperty = DependencyProperty.Register(
-            "IsFlowing", typeof (bool), typeof (FlowPipeV2),
+            "IsFlowing", typeof(bool), typeof(FlowPipeV2),
             new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
 
         public static readonly DependencyProperty IsSlowFlowingProperty = DependencyProperty.Register(
-            "IsSlowFlowing", typeof (bool), typeof (FlowPipeV2),
+            "IsSlowFlowing", typeof(bool), typeof(FlowPipeV2),
             new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
 
         public static readonly DependencyProperty ValveOpenOrientationProperty = DependencyProperty.Register(
-            "FlowOrientation", typeof (LineOrientation), typeof (FlowPipeV2),
+            "FlowOrientation", typeof(LineOrientation), typeof(FlowPipeV2),
             new FrameworkPropertyMetadata(LineOrientation.Horizontal, FrameworkPropertyMetadataOptions.AffectsRender));
 
         public static readonly DependencyProperty IsReverseProperty = DependencyProperty.Register(
@@ -46,12 +46,12 @@ namespace Aitex.Core.UI.Control
             new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
 
         public static readonly DependencyProperty GasTypeProperty = DependencyProperty.Register(
-            "GasType", typeof (GasTypeEnum), typeof (FlowPipeV2),
+            "GasType", typeof(GasTypeEnum), typeof(FlowPipeV2),
             new FrameworkPropertyMetadata(GasTypeEnum.CarrierGas, FrameworkPropertyMetadataOptions.AffectsRender));
 
         public LineOrientation FlowOrientation
         {
-            get { return (LineOrientation) GetValue(ValveOpenOrientationProperty); }
+            get { return (LineOrientation)GetValue(ValveOpenOrientationProperty); }
             set { SetValue(ValveOpenOrientationProperty, value); }
         }
 
@@ -62,19 +62,19 @@ namespace Aitex.Core.UI.Control
         /// </summary>
         public bool IsFlowing
         {
-            get { return (bool) this.GetValue(IsFlowingProperty); }
+            get { return (bool)this.GetValue(IsFlowingProperty); }
             set { this.SetValue(IsFlowingProperty, value); }
         }
 
         public bool IsSlowFlowing
         {
-            get { return (bool) this.GetValue(IsSlowFlowingProperty); }
+            get { return (bool)this.GetValue(IsSlowFlowingProperty); }
             set { this.SetValue(IsSlowFlowingProperty, value); }
         }
 
         public GasTypeEnum GasType
         {
-            get { return (GasTypeEnum) this.GetValue(GasTypeProperty); }
+            get { return (GasTypeEnum)this.GetValue(GasTypeProperty); }
             set { this.SetValue(GasTypeProperty, value); }
         }
 
@@ -112,17 +112,17 @@ namespace Aitex.Core.UI.Control
             {
                 this.Visibility = IsFlowing ? Visibility.Visible : Visibility.Hidden;
             }
- 
+
             switch (GasType)
             {
-                    //case GasTypeEnum.Fast:
-                    //    _pathStrokeBrush = CarrierGasBrush;
-                    //    path1.StrokeThickness = 5;
-                    //    break;
-                    //case GasTypeEnum.Slow:
-                    //    _pathStrokeBrush = CarrierGasBrush;
-                    //    path1.StrokeThickness = 3;
-                    //    break;
+                //case GasTypeEnum.Fast:
+                //    _pathStrokeBrush = CarrierGasBrush;
+                //    path1.StrokeThickness = 5;
+                //    break;
+                //case GasTypeEnum.Slow:
+                //    _pathStrokeBrush = CarrierGasBrush;
+                //    path1.StrokeThickness = 3;
+                //    break;
                 case GasTypeEnum.CarrierGas:
                     _pathStrokeBrush = CarrierGasBrush;
                     break;
@@ -143,7 +143,7 @@ namespace Aitex.Core.UI.Control
             if (IsSlowFlowing && !IsFlowing)
                 path1.StrokeThickness = 3;
             else if (IsFlowing)
-                path1.StrokeThickness = 15;
+                path1.StrokeThickness = 5;
         }
     }
 }

+ 0 - 7
Venus/Framework/UICore/UICore.csproj

@@ -176,9 +176,6 @@
     <Compile Include="Control\FlowPipeV2.xaml.cs">
       <DependentUpon>FlowPipeV2.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Control\FlowPipeValve.xaml.cs">
-      <DependentUpon>FlowPipeValve.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Control\GasFlowButton.xaml.cs">
       <DependentUpon>GasFlowButton.xaml</DependentUpon>
     </Compile>
@@ -567,10 +564,6 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
-    <Page Include="Control\FlowPipeValve.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="Control\GasFlowButton.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>

+ 18 - 14
Venus/Venus_MainPages/Views/OverView.xaml

@@ -7,19 +7,23 @@
              mc:Ignorable="d" 
              xmlns:prism="http://prismlibrary.com/"
              prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:ctrls="clr-namespace:Aitex.Core.UI.Control;assembly=MECF.Framework.UI.Core"
+             xmlns:ctrls="clr-namespace:Venus_Themes.UserControls;assembly=Venus_Themes"
              d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-        <Grid.RowDefinitions>
-            <RowDefinition/>
-            <RowDefinition/>
-            <RowDefinition/>
-            <RowDefinition/>
-            <RowDefinition/>
-            <RowDefinition/>
-        </Grid.RowDefinitions>
-        <ctrls:FlowPipeValve Name="flv"/>
-        <ctrls:FlowPipeV2 Grid.Row="1" Height="20" Name="fl2" Width="200"/>
-        <Button Grid.Row="2" Width="100" Height="20" Click="Button_Click"  Content="Switch"/>
-    </Grid>
+    <Canvas>
+        <ctrls:FlowPipeValve Height="10" Name="flv" Canvas.Left="190" Canvas.Top="75"/>
+        <ctrls:FlowPipe  Height="10" Name="fl1" Width="100" Canvas.Left="118" Canvas.Top="120"/>
+        <ctrls:FlowPipe  Height="10" Name="fl2" Width="100" Canvas.Left="315.3" Canvas.Top="120"/>
+        <ctrls:FlowPipe  Height="10" Name="fl3" Width="100" Canvas.Left="360" Canvas.Top="170" RenderTransformOrigin="0.5,0.5" FCornerRadius="0,0,0,5">
+            <ctrls:FlowPipe.RenderTransform>
+                <TransformGroup>
+                    <RotateTransform Angle="90"/>
+                </TransformGroup>
+            </ctrls:FlowPipe.RenderTransform>
+        </ctrls:FlowPipe>
+        <ctrls:FlowPipe  Height="10" Name="fl4" Width="100" Canvas.Left="407.3" Canvas.Top="218" />
+
+        <Button  Width="100" Height="20" Click="Button_Click"  Content="流动" Canvas.Left="115" Canvas.Top="225"/>
+
+        <Button  Width="100" Height="20" Click="Button_Click_1"  Content="反向" Canvas.Left="250" Canvas.Top="225"/>
+    </Canvas>
 </UserControl>

+ 33 - 17
Venus/Venus_MainPages/Views/OverView.xaml.cs

@@ -1,17 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
+using System.Windows;
 using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
 using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
 
 namespace Venus_MainPages.Views
 {
@@ -23,18 +12,45 @@ namespace Venus_MainPages.Views
         public OverView()
         {
             InitializeComponent();
-            fl2.IsFlowing = false;
-            fl2.IsSlowFlowing = false;
+            fl1.IsFlowing = true;
+            fl1.FlowColor = new SolidColorBrush(Colors.Red);
+            fl2.IsFlowing = true;
+            fl3.IsFlowing = true;
+            fl4.IsFlowing = true;
+
             flv.IsOpen = false;
         }
-       
+
+        bool isreserve;
         private void Button_Click(object sender, RoutedEventArgs e)
         {
+            fl1.IsFlowing = !fl1.IsFlowing;
             fl2.IsFlowing = !fl2.IsFlowing;
-
-            fl2.IsSlowFlowing = !fl2.IsSlowFlowing;
+            fl3.IsFlowing = !fl3.IsFlowing;
+            fl4.IsFlowing = !fl4.IsFlowing;
 
             flv.IsOpen = !flv.IsOpen;
         }
+
+        private void Button_Click_1(object sender, RoutedEventArgs e)
+        {
+            if (isreserve == true)
+            {
+
+                fl1.FlowDirection = FlowDirection.LeftToRight;
+                fl2.FlowDirection = FlowDirection.LeftToRight;
+                fl3.FlowDirection = FlowDirection.LeftToRight;
+                fl4.FlowDirection = FlowDirection.LeftToRight;
+            }
+            else
+            {
+                fl1.FlowDirection = FlowDirection.RightToLeft;
+                fl2.FlowDirection = FlowDirection.RightToLeft;
+                fl3.FlowDirection = FlowDirection.RightToLeft;
+                fl4.FlowDirection = FlowDirection.RightToLeft;
+            }
+            isreserve = !isreserve;
+
+        }
     }
 }

+ 25 - 0
Venus/Venus_Themes/Converters/BoolToReverse.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Venus_Themes.Converters
+{
+    public class BoolToReverse : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+
+            return (bool)value ? 70 : 20;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+
+        }
+    }
+}

+ 25 - 0
Venus/Venus_Themes/Converters/BoolToVisibility.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Venus_Themes.Converters
+{
+    internal class BoolToVisibility : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+
+            return (bool)value ? Visibility.Visible : Visibility.Collapsed;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+
+        }
+    }
+}

+ 21 - 0
Venus/Venus_Themes/Converters/IntPlusConverter.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Windows.Data;
+
+namespace Venus_Themes.Converters
+{
+    public class IntPlusConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            int var =System.Convert.ToInt32(value);
+
+            return var + 8;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            return null;
+
+        }
+    }
+}

+ 64 - 0
Venus/Venus_Themes/UserControls/FlowPipe.xaml

@@ -0,0 +1,64 @@
+<UserControl x:Class="Venus_Themes.UserControls.FlowPipe"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:converters="clr-namespace:Venus_Themes.Converters"
+             Name="flowPipeControl" Width="100" Height="8">
+    <UserControl.Resources>
+        <converters:BoolToReverse x:Key="boolToReverse"/>
+    </UserControl.Resources>
+    <UserControl.RenderTransform>
+        <RotateTransform Angle="0" x:Name="rotateTransform"/>
+    </UserControl.RenderTransform>
+        <Canvas MinHeight="4" MinWidth="100">
+        <Canvas.Resources>
+            <Style x:Key="AnimatingFlow" TargetType="{x:Type Line}">
+                <Style.Triggers>
+                    <DataTrigger Binding="{Binding ElementName=flowPipeControl,Path=IsFlowing}" Value="True">
+                        <DataTrigger.EnterActions>
+                            <BeginStoryboard Name="FlowStoryboard">
+                                <Storyboard RepeatBehavior="Forever" Timeline.DesiredFrameRate="10">
+                                    <DoubleAnimation Storyboard.TargetProperty="StrokeDashOffset" Duration="0:0:10" To="70"/>
+                                </Storyboard>
+                            </BeginStoryboard>
+                            <BeginStoryboard >
+                                <Storyboard>
+                                    <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:1" By="0.3" />
+                                </Storyboard>
+                            </BeginStoryboard>
+                        </DataTrigger.EnterActions>
+                        <DataTrigger.ExitActions>
+                            <BeginStoryboard>
+                                <Storyboard>
+                                    <DoubleAnimation  Storyboard.TargetProperty="Opacity" Duration="0:0:1"  To="0"/>
+                                </Storyboard>
+                            </BeginStoryboard>
+                            <StopStoryboard BeginStoryboardName="FlowStoryboard" />
+                        </DataTrigger.ExitActions>
+                    </DataTrigger>
+                </Style.Triggers>
+            </Style>
+        </Canvas.Resources>
+
+
+        <Border   x:Name="border1"    CornerRadius="{Binding ElementName=flowPipeControl,Path=FCornerRadius}"  BorderBrush="Gray"  BorderThickness="0" 
+                  Width="{Binding ElementName=flowPipeControl,Path=Width}" Height="{Binding ElementName=flowPipeControl,Path=Height}">
+            <Border.Background>
+                <LinearGradientBrush StartPoint="0.5 0" EndPoint="0.5 1">
+                    <GradientStop Color="Silver" Offset="0"/>
+                    <GradientStop Color="White" Offset="0.5"/>
+                    <GradientStop Color="Silver" Offset="1"/>
+                </LinearGradientBrush>
+            </Border.Background>
+        </Border>
+        <Line Name="path1" 
+              X1="0" Y1="0" X2="80" Y2="0"
+              Opacity="0"
+              Stretch="Fill" 
+              Width="{Binding ElementName=flowPipeControl,Path=Width}" 
+              Height="{Binding ElementName=flowPipeControl,Path=Height}" 
+              Stroke="{Binding ElementName=flowPipeControl, Path=FlowColor}"  StrokeDashArray="1,3" StrokeDashCap="Round"
+              StrokeThickness="{Binding ElementName=flowPipeControl,Path=Height}" 
+              Style="{StaticResource AnimatingFlow}">
+        </Line>
+    </Canvas>
+</UserControl>

+ 60 - 0
Venus/Venus_Themes/UserControls/FlowPipe.xaml.cs

@@ -0,0 +1,60 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+
+namespace Venus_Themes.UserControls
+{
+    /// <summary>
+    /// Interaction logic for FlowPipe.xaml
+    /// </summary>
+    public partial class FlowPipe : UserControl
+    {
+        public FlowPipe()
+        {
+            InitializeComponent();
+            
+        }
+
+
+        public static readonly DependencyProperty FCornerRadiusProperty = DependencyProperty.Register(
+           "FCornerRadius", typeof(CornerRadius), typeof(FlowPipe),
+           new FrameworkPropertyMetadata(new CornerRadius(2), FrameworkPropertyMetadataOptions.AffectsRender));
+        
+
+        public static readonly DependencyProperty IsFlowingProperty = DependencyProperty.Register(
+            "IsFlowing", typeof (bool), typeof (FlowPipe),
+            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
+
+        public static readonly DependencyProperty FlowColorProperty = DependencyProperty.Register(
+           "FlowColor", typeof(SolidColorBrush), typeof(FlowPipe),
+           new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Green), FrameworkPropertyMetadataOptions.AffectsRender));
+
+
+
+        public bool IsFlowing
+        {
+            get { return (bool) this.GetValue(IsFlowingProperty); }
+            set { this.SetValue(IsFlowingProperty, value); }
+        }
+
+        public SolidColorBrush FlowColor
+        {
+            get { return (SolidColorBrush)this.GetValue(FlowColorProperty); }
+            set { this.SetValue(FlowColorProperty, value); }
+        }
+
+        public CornerRadius FCornerRadius
+        {
+            get { return (CornerRadius)this.GetValue(FCornerRadiusProperty); }
+            set { this.SetValue(FCornerRadiusProperty, value); }
+        }
+
+        public bool IsVertical { get; set; }
+
+        protected override void OnRender(DrawingContext drawingContext)
+        {
+            base.OnRender(drawingContext);
+        }
+    }
+}

File diff suppressed because it is too large
+ 47 - 0
Venus/Venus_Themes/UserControls/FlowPipeValve.xaml


+ 1 - 1
Venus/Framework/UICore/Control/FlowPipeValve.xaml.cs

@@ -13,7 +13,7 @@ using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 
-namespace Aitex.Core.UI.Control
+namespace Venus_Themes.UserControls
 {
     /// <summary>
     /// FlowPipeValve.xaml 的交互逻辑

+ 54 - 0
Venus/Venus_Themes/UserControls/Pipe.xaml

@@ -0,0 +1,54 @@
+<UserControl x:Class="Venus_Themes.UserControls.Pipe"
+             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:Venus_Themes.UserControls"
+             mc:Ignorable="d" 
+             Name="flowPipeControl" Width="100" Height="8">
+    <UserControl.RenderTransform>
+        <RotateTransform Angle="0" x:Name="rotateTransform"/>
+    </UserControl.RenderTransform>
+    <Canvas MinHeight="4" MinWidth="100">
+        <Canvas.Resources>
+            <Style x:Key="AnimatingFlow" TargetType="{x:Type Line}">
+                <Style.Triggers>
+                    <DataTrigger Binding="{Binding ElementName=flowPipeControl,Path=IsFlowing}" Value="True">
+                        <DataTrigger.EnterActions>
+                            <BeginStoryboard Name="FlowStoryboard">
+                                <Storyboard RepeatBehavior="Forever" Timeline.DesiredFrameRate="10">
+                                    <DoubleAnimation  Storyboard.TargetProperty="StrokeDashOffset" Duration="0:0:10" By="70" />
+                                </Storyboard>
+                            </BeginStoryboard>
+                        </DataTrigger.EnterActions>
+                        <DataTrigger.ExitActions>
+                            <BeginStoryboard>
+                                <Storyboard FillBehavior="Stop">
+                                    <DoubleAnimation Storyboard.TargetProperty="StrokeDashOffset" Duration="0"/>
+                                </Storyboard>
+                            </BeginStoryboard>
+                            <StopStoryboard BeginStoryboardName="FlowStoryboard"/>
+                        </DataTrigger.ExitActions>
+                    </DataTrigger>
+                </Style.Triggers>
+            </Style>
+        </Canvas.Resources>
+
+
+        <Border   x:Name="border1"      BorderBrush="Gray"   CornerRadius="3" BorderThickness="0,0,0,0"
+                  Width="{Binding ElementName=flowPipeControl,Path=Width}" Height="{Binding ElementName=flowPipeControl,Path=Height}">
+            <Border.Background>
+                <LinearGradientBrush StartPoint="0.5 0" EndPoint="0.5 1">
+                    <GradientStop Color="Silver" Offset="0"/>
+                    <GradientStop Color="White" Offset="0.5"/>
+                    <GradientStop Color="Silver" Offset="1"/>
+                </LinearGradientBrush>
+            </Border.Background>
+        </Border>
+        <Line  Name="path1" X1="0" Y1="0" X2="80" Y2="0"  Stretch="Fill" Opacity="0.4"
+              Width="{Binding ElementName=flowPipeControl,Path=Width}" 
+              Height="{Binding ElementName=border1,Path=Height}" 
+              Stroke="Green" StrokeDashArray="1,3" StrokeDashCap="Round" StrokeThickness="15"
+              Style="{StaticResource AnimatingFlow}"/>
+    </Canvas>
+</UserControl>

+ 70 - 0
Venus/Venus_Themes/UserControls/Pipe.xaml.cs

@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Venus_Themes.UserControls
+{
+    /// <summary>
+    /// Pipe.xaml 的交互逻辑
+    /// </summary>
+    public partial class Pipe : UserControl
+    {
+        public Pipe()
+        {
+            InitializeComponent();
+        }
+        public static readonly DependencyProperty IsFlowingProperty = DependencyProperty.Register(
+         "IsFlowing", typeof(bool), typeof(Pipe),
+         new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
+
+
+
+        public static readonly DependencyProperty IsReverseProperty = DependencyProperty.Register(
+            "IsReverse", typeof(bool), typeof(Pipe),
+            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
+
+
+
+        public bool IsFlowing
+        {
+            get { return (bool)this.GetValue(IsFlowingProperty); }
+            set { this.SetValue(IsFlowingProperty, value); }
+        }
+
+
+
+
+
+        public bool IsReverse
+        {
+            get
+            {
+                return (bool)this.GetValue(IsReverseProperty);
+            }
+            set
+            {
+                this.SetValue(IsReverseProperty, value);
+            }
+        }
+
+        public bool IsVertical { get; set; }
+
+
+        protected override void OnRender(DrawingContext drawingContext)
+        {
+            base.OnRender(drawingContext);
+
+        }
+    }
+}

File diff suppressed because it is too large
+ 5 - 5
Venus/Framework/UICore/Control/FlowPipeValve.xaml


+ 51 - 0
Venus/Venus_Themes/UserControls/PipeValve.xaml.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Venus_Themes.UserControls
+{
+    /// <summary>
+    /// PipeValve.xaml 的交互逻辑
+    /// </summary>
+    public partial class PipeValve : UserControl
+    {
+        public PipeValve()
+        {
+            InitializeComponent();
+        }
+        public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(
+        "IsOpen", typeof(bool), typeof(PipeValve));
+
+        public bool IsOpen
+        {
+            get { return (bool)this.GetValue(IsOpenProperty); }
+            set
+            {
+                if (value == true)
+                {
+                    openValve.Visibility = Visibility.Visible;
+                    closeValve.Visibility = Visibility.Collapsed;
+                }
+                else
+                {
+                    openValve.Visibility = Visibility.Collapsed;
+                    closeValve.Visibility = Visibility.Visible;
+                }
+                this.SetValue(IsOpenProperty, value);
+
+            }
+        }
+
+    }
+}

+ 17 - 0
Venus/Venus_Themes/Venus_Themes.csproj

@@ -52,6 +52,9 @@
     <Reference Include="WindowsBase" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Converters\BoolToReverse.cs" />
+    <Compile Include="Converters\BoolToVisibility.cs" />
+    <Compile Include="Converters\IntPlusConverter.cs" />
     <Compile Include="CustomControls\AduRadioButtonIcon.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Themes\Attach\BorderElement.cs" />
@@ -59,6 +62,12 @@
     <Compile Include="Themes\Attach\ElementBrushBase.cs" />
     <Compile Include="Themes\Attach\ElementForeground.cs" />
     <Compile Include="Themes\Attach\IconElement.cs" />
+    <Compile Include="UserControls\FlowPipe.xaml.cs">
+      <DependentUpon>FlowPipe.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="UserControls\FlowPipeValve.xaml.cs">
+      <DependentUpon>FlowPipeValve.xaml</DependentUpon>
+    </Compile>
     <Compile Include="UserControls\WPFMessageBox.xaml.cs">
       <DependentUpon>WPFMessageBox.xaml</DependentUpon>
     </Compile>
@@ -132,6 +141,14 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="UserControls\FlowPipe.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="UserControls\FlowPipeValve.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="UserControls\WPFMessageBox.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>