AITGasIIIValve.xaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 Timeline.DesiredFrameRate="3"
  16. FillBehavior="HoldEnd"
  17. Storyboard.TargetName="imgValveClose"
  18. Storyboard.TargetProperty="Opacity"
  19. To="0"
  20. Duration="0:0:0.3" />
  21. </Storyboard>
  22. <Storyboard x:Key="FlickerValveStoryBoard" RepeatBehavior="Forever">
  23. <DoubleAnimation Timeline.DesiredFrameRate="3"
  24. FillBehavior="Stop"
  25. Storyboard.TargetName="imgValveOpen"
  26. Storyboard.TargetProperty="Opacity"
  27. From="0"
  28. To="1"
  29. Duration="0:0:0.3" />
  30. <DoubleAnimation Timeline.DesiredFrameRate="3"
  31. FillBehavior="Stop"
  32. Storyboard.TargetName="imgValveClose"
  33. Storyboard.TargetProperty="Opacity"
  34. From="1"
  35. To="0"
  36. Duration="0:0:0.3" />
  37. </Storyboard>
  38. <Storyboard x:Key="CloseValveStoryBoard">
  39. <DoubleAnimation Timeline.DesiredFrameRate="3"
  40. FillBehavior="HoldEnd"
  41. Storyboard.TargetName="imgValveClose"
  42. Storyboard.TargetProperty="Opacity"
  43. To="100"
  44. Duration="0:0:0.3" />
  45. </Storyboard>
  46. <converters:RotateTransformConverter x:Key="transformConvert" />
  47. </UserControl.Resources>
  48. <UserControl.RenderTransform>
  49. <RotateTransform x:Name="rotateTransform" CenterX="{Binding ElementName=GasValve, Path=Width, Converter={StaticResource transformConvert}}" CenterY="{Binding ElementName=GasValve, Path=Height, Converter={StaticResource transformConvert}}" />
  50. </UserControl.RenderTransform>
  51. <Grid
  52. IsEnabled="{Binding IsManagerPermission}"
  53. MouseLeftButtonUp="imgValveClose_MouseLeftButtonUp"
  54. TouchUp="imgValve_TouchUp">
  55. <Image
  56. Name="imgValveOpen"
  57. Width="{Binding ElementName=GasValve, Path=Width}"
  58. Height="{Binding ElementName=GasValve, Path=Height}" />
  59. <Image
  60. Name="imgValveClose"
  61. Width="{Binding ElementName=GasValve, Path=Width}"
  62. Height="{Binding ElementName=GasValve, Path=Height}" />
  63. <TextBlock
  64. x:Name="ValveName"
  65. Margin="-1,0,0,0"
  66. HorizontalAlignment="Center"
  67. VerticalAlignment="Center"
  68. FontFamily="Calibri"
  69. FontSize="10"
  70. Text="{Binding ValveDisplayName}" />
  71. <Button
  72. VerticalContentAlignment="Stretch"
  73. Panel.ZIndex="-1"
  74. Background="DarkGray"
  75. Visibility="{Binding ElementName=GasValve, Path=IsDisableMode, Converter={StaticResource bool2VisibilityConverter}}" />
  76. </Grid>
  77. </UserControl>