AITGasIIValve.xaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <UserControl x:Class="Aitex.Core.UI.DeviceControl.AITGasIIValve"
  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. xmlns:converters1="clr-namespace:MECF.Framework.UI.Core.Converters"
  9. mc:Ignorable="d"
  10. Height="32" Width="32" Loaded="AITGasIIValve_OnLoaded"
  11. Name="GasIIValve">
  12. <UserControl.Resources>
  13. <converters1:BoolToBrushConverter x:Key="boolToBrushConverter"></converters1:BoolToBrushConverter>
  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. Storyboard.TargetName="imgValveClose"
  21. Storyboard.TargetProperty="Opacity"
  22. To="0" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>
  23. </Storyboard>
  24. <Storyboard x:Key="CloseValveStoryBoard">
  25. <!--<DoubleAnimation
  26. Storyboard.TargetName="rotateTransform"
  27. Storyboard.TargetProperty="Angle"
  28. To="0" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->
  29. <DoubleAnimation
  30. Storyboard.TargetName="imgValveClose"
  31. Storyboard.TargetProperty="Opacity"
  32. To="100" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>
  33. </Storyboard>
  34. <converters:RotateTransformConverter x:Key="transformConvert"/>
  35. </UserControl.Resources>
  36. <UserControl.RenderTransform>
  37. <RotateTransform x:Name="rotateTransform" CenterX="{Binding ElementName=GasIIValve,Path=Width,Converter={StaticResource transformConvert}}"
  38. CenterY="{Binding ElementName=GasIIValve,Path=Height,Converter={StaticResource transformConvert}}"/>
  39. </UserControl.RenderTransform>
  40. <Grid MouseLeftButtonUp="imgValveClose_MouseLeftButtonUp" TouchUp="imgValve_TouchUp" IsEnabled="{Binding IsManagerPermission}">
  41. <Image Name="imgValveOpen" Width="{Binding ElementName=GasIIValve,Path=Width}" Height="{Binding ElementName=GasIIValve,Path=Height}"/>
  42. <Image Name="imgValveClose" Width="{Binding ElementName=GasIIValve,Path=Width}" Height="{Binding ElementName=GasIIValve,Path=Height}"/>
  43. <TextBlock Text="{Binding ElementName=GasIIValve, Path=ValveDisplayName,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="{Binding ElementName=GasIIValve, Path=IsSwitchOpen,Converter={StaticResource boolToBrushConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="20" FontFamily="SimSun" Block.TextAlignment="Center" FontSize="10" x:Name="ValveName"/>
  44. <Border BorderThickness="2" BorderBrush="Gray" Visibility="{Binding ElementName=GasIIValve,Path=IsDisableMode ,Converter={StaticResource bool2VisibilityConverter}}">
  45. </Border>
  46. </Grid>
  47. </UserControl>