终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

82 lines
3.3 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.UserControls.ConveyorBelt"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. d:DesignHeight="300"
  9. d:DesignWidth="800"
  10. mc:Ignorable="d">
  11. <UserControl.Resources>
  12. <Storyboard x:Key="Left" RepeatBehavior="Forever">
  13. <DoubleAnimation
  14. Storyboard.TargetName="mp"
  15. Storyboard.TargetProperty="StrokeDashOffset"
  16. From="0"
  17. To="100"
  18. Duration="0:0:20" />
  19. </Storyboard>
  20. <Storyboard x:Key="Right" RepeatBehavior="Forever">
  21. <DoubleAnimation
  22. Storyboard.TargetName="mp"
  23. Storyboard.TargetProperty="StrokeDashOffset"
  24. From="0"
  25. To="-100"
  26. Duration="0:0:20" />
  27. </Storyboard>
  28. </UserControl.Resources>
  29. <Grid Name="cav">
  30. <Viewbox Width="auto" Height="auto">
  31. <Canvas Width="{Binding ElementName=cav, Path=ActualWidth}" Height="{Binding ElementName=cav, Path=ActualHeight}">
  32. <Path
  33. Name="mp"
  34. Margin="0"
  35. Stroke="{Binding StrokeFillBrush, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
  36. StrokeDashArray="{Binding StrokeDashArray, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
  37. StrokeThickness="{Binding ConveyorBeltWidth, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
  38. <Path
  39. Name="cb"
  40. Fill="Transparent"
  41. Stroke="{Binding StrokeBrush, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
  42. StrokeThickness="{Binding StrokeThickness, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
  43. </Canvas>
  44. </Viewbox>
  45. <VisualStateManager.VisualStateGroups>
  46. <VisualStateGroup>
  47. <VisualState Name="Left">
  48. <Storyboard x:Name="sb" RepeatBehavior="Forever">
  49. <DoubleAnimation
  50. Storyboard.TargetName="mp"
  51. Storyboard.TargetProperty="StrokeDashOffset"
  52. From="0"
  53. To="100"
  54. Duration="0:0:20" />
  55. </Storyboard>
  56. </VisualState>
  57. <VisualState Name="Right">
  58. <Storyboard RepeatBehavior="Forever">
  59. <DoubleAnimation
  60. Storyboard.TargetName="mp"
  61. Storyboard.TargetProperty="StrokeDashOffset"
  62. From="0"
  63. To="-100"
  64. Duration="0:0:20" />
  65. </Storyboard>
  66. </VisualState>
  67. <VisualState Name="Stop" />
  68. </VisualStateGroup>
  69. </VisualStateManager.VisualStateGroups>
  70. </Grid>
  71. </UserControl>