ProcessBarAm.xaml 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:local="clr-namespace:Yunda.SOMS.DataMonitoringServer.Viewport.Domain.Helper">
  4. <Style TargetType="{x:Type local:ProcessStatusCtrl}">
  5. <Setter Property="Template">
  6. <Setter.Value>
  7. <ControlTemplate TargetType="{x:Type local:ProcessStatusCtrl}">
  8. <Border Background="{TemplateBinding Background}"
  9. BorderBrush="{TemplateBinding BorderBrush}"
  10. BorderThickness="{TemplateBinding BorderThickness}">
  11. <Rectangle>
  12. <Rectangle.Fill>
  13. <LinearGradientBrush StartPoint="0 0"
  14. EndPoint="1 0">
  15. <GradientStop Color="Transparent"
  16. Offset="0"
  17. x:Name="gs1" />
  18. <GradientStop Color="#01D328"
  19. Offset="0"
  20. x:Name="gs2" />
  21. <GradientStop Color="#01D328"
  22. Offset="0"
  23. x:Name="gs3" />
  24. <GradientStop Color="Transparent"
  25. Offset="0"
  26. x:Name="gs4" />
  27. </LinearGradientBrush>
  28. </Rectangle.Fill>
  29. </Rectangle>
  30. </Border>
  31. <ControlTemplate.Triggers>
  32. <DataTrigger Binding="{Binding Open,RelativeSource={RelativeSource Self}}" Value="True">
  33. <DataTrigger.EnterActions>
  34. <BeginStoryboard x:Name="sb">
  35. <Storyboard RepeatBehavior="Forever">
  36. <DoubleAnimation Storyboard.TargetName="gs1"
  37. Storyboard.TargetProperty="Offset"
  38. From="0"
  39. To="1"
  40. BeginTime="0:0:0.13"
  41. Duration="0:0:1.3"></DoubleAnimation>
  42. <DoubleAnimation Storyboard.TargetName="gs2"
  43. Storyboard.TargetProperty="Offset"
  44. From="0"
  45. To=" 1"
  46. BeginTime="0:0:0.13"
  47. Duration="0:0:1.3"></DoubleAnimation>
  48. <DoubleAnimation Storyboard.TargetName="gs3"
  49. Storyboard.TargetProperty="Offset"
  50. From="0"
  51. To=" 1"
  52. Duration="0:0:1.3"></DoubleAnimation>
  53. <DoubleAnimation Storyboard.TargetName="gs4"
  54. Storyboard.TargetProperty="Offset"
  55. From="0"
  56. To="1"
  57. Duration="0:0:1.3"></DoubleAnimation>
  58. </Storyboard>
  59. </BeginStoryboard>
  60. </DataTrigger.EnterActions>
  61. <DataTrigger.ExitActions>
  62. <StopStoryboard BeginStoryboardName="sb" />
  63. </DataTrigger.ExitActions>
  64. </DataTrigger>
  65. </ControlTemplate.Triggers>
  66. </ControlTemplate>
  67. </Setter.Value>
  68. </Setter>
  69. </Style>
  70. </ResourceDictionary>