AITGasValve.xaml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <UserControl x:Class="Aitex.Core.UI.DeviceControl.AITGasValve"
  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:sys="clr-namespace:System;assembly=mscorlib"
  7. xmlns:converters="clr-namespace:Aitex.Core.UI.Converters"
  8. mc:Ignorable="d"
  9. Loaded="AITGasValve_OnLoaded"
  10. Height="32" Width="32"
  11. Name="GasValve">
  12. <UserControl.Resources>
  13. <Storyboard x:Key="OpenValveStoryBoard">
  14. <!--<DoubleAnimation
  15. Storyboard.TargetName="rotateTransform"
  16. Storyboard.TargetProperty="Angle"
  17. To="90" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->
  18. <DoubleAnimation
  19. Storyboard.TargetName="imgValveClose"
  20. Storyboard.TargetProperty="Opacity"
  21. To="0" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>
  22. </Storyboard>
  23. <Storyboard x:Key="FlickerValveStoryBoard">
  24. <!--<DoubleAnimation
  25. Storyboard.TargetName="rotateTransform"
  26. Storyboard.TargetProperty="Angle"
  27. To="90" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->
  28. <DoubleAnimation
  29. Storyboard.TargetName="imgValveClose"
  30. Storyboard.TargetProperty="Opacity"
  31. From="0" To="1" Duration="0:0:2" FillBehavior="HoldEnd"></DoubleAnimation>
  32. <DoubleAnimation
  33. Storyboard.TargetName="imgValveClose"
  34. Storyboard.TargetProperty="Opacity"
  35. From="1" To="0" Duration="0:0:2" FillBehavior="HoldEnd"></DoubleAnimation>
  36. </Storyboard>
  37. <Storyboard x:Key="CloseValveStoryBoard">
  38. <!--<DoubleAnimation
  39. Storyboard.TargetName="rotateTransform"
  40. Storyboard.TargetProperty="Angle"
  41. To="0" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->
  42. <DoubleAnimation
  43. Storyboard.TargetName="imgValveClose"
  44. Storyboard.TargetProperty="Opacity"
  45. To="100" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>
  46. </Storyboard>
  47. <converters:RotateTransformConverter x:Key="transformConvert"/>
  48. </UserControl.Resources>
  49. <UserControl.RenderTransform>
  50. <RotateTransform x:Name="rotateTransform" CenterX="{Binding ElementName=GasValve,Path=Width,Converter={StaticResource transformConvert}}"
  51. CenterY="{Binding ElementName=GasValve,Path=Height,Converter={StaticResource transformConvert}}"/>
  52. </UserControl.RenderTransform>
  53. <Grid MouseLeftButtonUp="imgValveClose_MouseLeftButtonUp" TouchUp="imgValve_TouchUp" IsEnabled="{Binding IsManagerPermission}" >
  54. <Button Panel.ZIndex="1" Background="DarkGray" VerticalContentAlignment="Stretch" Visibility="{Binding ElementName=GasValve,Path=IsDisableMode ,Converter={StaticResource bool2VisibilityConverter}}">
  55. </Button>
  56. <Image Panel.ZIndex="2" Name="imgValveOpen" Width="{Binding ElementName=GasValve,Path=Width}" Height="{Binding ElementName=GasValve,Path=Height}"/>
  57. <Image Panel.ZIndex="3" Name="imgValveClose" Width="{Binding ElementName=GasValve,Path=Width}" Height="{Binding ElementName=GasValve,Path=Height}"/>
  58. <TextBlock Panel.ZIndex="4" Text="{Binding ValveDisplayName}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="-1 0 0 0" FontFamily="Calibri" FontSize="10" x:Name="ValveName"/>
  59. </Grid>
  60. </UserControl>