GasSingularLine.xaml 6.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <UserControl x:Class="MECF.Framework.UI.Client.IndustrialControl.GasSingularLine"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:MECF.Framework.UI.Client.IndustrialControl"
  7. xmlns:converters="clr-namespace:MECF.Framework.UI.Client.IndustrialControl.Converters"
  8. mc:Ignorable="d" Height="95" Width="489">
  9. <UserControl.Resources>
  10. <converters:MultiplesValueConverter x:Key="multiConverter"></converters:MultiplesValueConverter>
  11. <converters:VisibilityConverter x:Key="visibilityConverter"></converters:VisibilityConverter>
  12. </UserControl.Resources>
  13. <Grid>
  14. <VisualStateManager.VisualStateGroups>
  15. <VisualStateGroup>
  16. <VisualState Name="WEFlowState">
  17. <Storyboard RepeatBehavior="Forever">
  18. <DoubleAnimation Duration="0:0:1" From="0" To="10"
  19. RepeatBehavior="Forever"
  20. Storyboard.TargetName="path1"
  21. Storyboard.TargetProperty="StrokeDashOffset"/>
  22. </Storyboard>
  23. </VisualState>
  24. <VisualState Name="EWFlowState">
  25. <Storyboard RepeatBehavior="Forever">
  26. <DoubleAnimation Duration="0:0:1" From="0" To="-10"
  27. RepeatBehavior="Forever"
  28. Storyboard.TargetName="path1"
  29. Storyboard.TargetProperty="StrokeDashOffset"/>
  30. </Storyboard>
  31. </VisualState>
  32. </VisualStateGroup>
  33. </VisualStateManager.VisualStateGroups>
  34. <Grid x:Name="grid1">
  35. <Grid.ColumnDefinitions>
  36. <ColumnDefinition Width="auto"></ColumnDefinition>
  37. <ColumnDefinition Width="*"></ColumnDefinition>
  38. <ColumnDefinition Width="auto"></ColumnDefinition>
  39. </Grid.ColumnDefinitions>
  40. <Canvas x:Name="canvas1" Grid.Column="0" Width="{Binding ElementName=grid1,Path=ActualHeight}" Height="{Binding ElementName=grid1,Path=ActualHeight}" ClipToBounds="True">
  41. <Ellipse x:Name="ellipe1" Grid.Column="0" Width="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=2}"
  42. Height="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=2}" Margin="0,0,0,0"
  43. Canvas.Left="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=0}"
  44. Canvas.Top="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=0}">
  45. <Ellipse.Fill>
  46. <RadialGradientBrush >
  47. <GradientStop Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=EdgeColor}" Offset="1"></GradientStop>
  48. <GradientStop Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=EdgeColor}" Offset="1"></GradientStop>
  49. </RadialGradientBrush>
  50. </Ellipse.Fill>
  51. </Ellipse>
  52. </Canvas>
  53. <Canvas x:Name="canvas2" Grid.Column="2" Width="{Binding ElementName=grid1,Path=ActualHeight}" Height="{Binding ElementName=grid1,Path=ActualHeight}" ClipToBounds="True">
  54. <Ellipse x:Name="ellipe2" Width="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=2}"
  55. Height="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=2}"
  56. Canvas.Left="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=-1}"
  57. Canvas.Top="{Binding ElementName=grid1,Path=ActualHeight,Converter={StaticResource multiConverter},ConverterParameter=-1}">
  58. <Ellipse.Fill>
  59. <RadialGradientBrush >
  60. <GradientStop Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=EdgeColor}" Offset="1"></GradientStop>
  61. <GradientStop Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=EdgeColor}" Offset="1"></GradientStop>
  62. </RadialGradientBrush>
  63. </Ellipse.Fill>
  64. </Ellipse>
  65. </Canvas>
  66. <Rectangle Grid.Column="1" Stretch="Fill">
  67. <Rectangle.Fill>
  68. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  69. <GradientStop Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=EdgeColor}" Offset="1"></GradientStop>
  70. <GradientStop Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=EdgeColor}" Offset="1"></GradientStop>
  71. </LinearGradientBrush>
  72. </Rectangle.Fill>
  73. </Rectangle>
  74. </Grid>
  75. <Path x:Name="path1"
  76. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=PipeLineActive,Converter={StaticResource visibilityConverter}}"
  77. StrokeThickness="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=PipeLineWidth}"
  78. StrokeDashOffset="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=LineOffect}" StrokeDashArray="5,5">
  79. <Path.Stroke>
  80. <SolidColorBrush Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:GasSingularLine}},Path=ActiveLineCenterColor}"></SolidColorBrush>
  81. </Path.Stroke>
  82. </Path>
  83. </Grid>
  84. </UserControl>