AITGasIIIValve.xaml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <UserControl
  2. x:Class="Aitex.Core.UI.DeviceControl.AITGasIIIValve"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:converters="clr-namespace:Aitex.Core.UI.Converters"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. Name="GasValve"
  9. Width="32"
  10. Height="32"
  11. Loaded="AITGasValve_OnLoaded"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <Storyboard x:Key="OpenValveStoryBoard">
  15. <!--<DoubleAnimation
  16. Storyboard.TargetName="rotateTransform"
  17. Storyboard.TargetProperty="Angle"
  18. To="90" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->
  19. <DoubleAnimation
  20. FillBehavior="HoldEnd"
  21. Storyboard.TargetName="imgValveClose"
  22. Storyboard.TargetProperty="Opacity"
  23. To="0"
  24. Duration="0:0:0.3" />
  25. </Storyboard>
  26. <Storyboard x:Key="FlickerValveStoryBoard">
  27. <!--<DoubleAnimation
  28. Storyboard.TargetName="rotateTransform"
  29. Storyboard.TargetProperty="Angle"
  30. To="90" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->
  31. <DoubleAnimation
  32. FillBehavior="HoldEnd"
  33. Storyboard.TargetName="imgValveClose"
  34. Storyboard.TargetProperty="Opacity"
  35. From="0"
  36. To="1"
  37. Duration="0:0:2" />
  38. <DoubleAnimation
  39. FillBehavior="HoldEnd"
  40. Storyboard.TargetName="imgValveClose"
  41. Storyboard.TargetProperty="Opacity"
  42. From="1"
  43. To="0"
  44. Duration="0:0:2" />
  45. </Storyboard>
  46. <Storyboard x:Key="CloseValveStoryBoard">
  47. <!--<DoubleAnimation
  48. Storyboard.TargetName="rotateTransform"
  49. Storyboard.TargetProperty="Angle"
  50. To="0" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->
  51. <DoubleAnimation
  52. FillBehavior="HoldEnd"
  53. Storyboard.TargetName="imgValveClose"
  54. Storyboard.TargetProperty="Opacity"
  55. To="100"
  56. Duration="0:0:0.3" />
  57. </Storyboard>
  58. <converters:RotateTransformConverter x:Key="transformConvert" />
  59. </UserControl.Resources>
  60. <UserControl.RenderTransform>
  61. <RotateTransform x:Name="rotateTransform" CenterX="{Binding ElementName=GasValve, Path=Width, Converter={StaticResource transformConvert}}" CenterY="{Binding ElementName=GasValve, Path=Height, Converter={StaticResource transformConvert}}" />
  62. </UserControl.RenderTransform>
  63. <Grid
  64. IsEnabled="{Binding IsManagerPermission}"
  65. MouseLeftButtonUp="imgValveClose_MouseLeftButtonUp"
  66. TouchUp="imgValve_TouchUp">
  67. <Image
  68. Name="imgValveOpen"
  69. Width="{Binding ElementName=GasValve, Path=Width}"
  70. Height="{Binding ElementName=GasValve, Path=Height}" />
  71. <Image
  72. Name="imgValveClose"
  73. Width="{Binding ElementName=GasValve, Path=Width}"
  74. Height="{Binding ElementName=GasValve, Path=Height}" />
  75. <TextBlock
  76. x:Name="ValveName"
  77. Margin="-1,0,0,0"
  78. HorizontalAlignment="Center"
  79. VerticalAlignment="Center"
  80. FontFamily="Calibri"
  81. FontSize="10"
  82. Text="{Binding ValveDisplayName}" />
  83. <Button
  84. VerticalContentAlignment="Stretch"
  85. Panel.ZIndex="-1"
  86. Background="DarkGray"
  87. Visibility="{Binding ElementName=GasValve, Path=IsDisableMode, Converter={StaticResource bool2VisibilityConverter}}" />
  88. </Grid>
  89. </UserControl>