| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 | <UserControl x:Class="Aitex.Core.UI.DeviceControl.AITGasValve"             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              xmlns:sys="clr-namespace:System;assembly=mscorlib"             xmlns:converters="clr-namespace:Aitex.Core.UI.Converters"             mc:Ignorable="d"              Loaded="AITGasValve_OnLoaded"              Height="32" Width="32"             Name="GasValve">    <UserControl.Resources>        <Storyboard x:Key="OpenValveStoryBoard">            <!--<DoubleAnimation                Storyboard.TargetName="rotateTransform"                Storyboard.TargetProperty="Angle"                To="90" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->            <DoubleAnimation                Storyboard.TargetName="imgValveClose"                Storyboard.TargetProperty="Opacity"                To="0" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>        </Storyboard>        <Storyboard x:Key="FlickerValveStoryBoard">            <!--<DoubleAnimation                Storyboard.TargetName="rotateTransform"                Storyboard.TargetProperty="Angle"                To="90" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->            <DoubleAnimation                Storyboard.TargetName="imgValveClose"                Storyboard.TargetProperty="Opacity"               From="0"  To="1" Duration="0:0:2" FillBehavior="HoldEnd"></DoubleAnimation>            <DoubleAnimation                Storyboard.TargetName="imgValveClose"                Storyboard.TargetProperty="Opacity"               From="1"  To="0" Duration="0:0:2" FillBehavior="HoldEnd"></DoubleAnimation>        </Storyboard>        <Storyboard x:Key="CloseValveStoryBoard">            <!--<DoubleAnimation                Storyboard.TargetName="rotateTransform"                Storyboard.TargetProperty="Angle"                To="0" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>-->            <DoubleAnimation                Storyboard.TargetName="imgValveClose"                Storyboard.TargetProperty="Opacity"                To="100" Duration="0:0:0.3" FillBehavior="HoldEnd"></DoubleAnimation>        </Storyboard>        <converters:RotateTransformConverter x:Key="transformConvert"/>    </UserControl.Resources>    <UserControl.RenderTransform>        <RotateTransform x:Name="rotateTransform" CenterX="{Binding ElementName=GasValve,Path=Width,Converter={StaticResource transformConvert}}"                          CenterY="{Binding ElementName=GasValve,Path=Height,Converter={StaticResource transformConvert}}"/>    </UserControl.RenderTransform>    <Grid  MouseLeftButtonUp="imgValveClose_MouseLeftButtonUp" TouchUp="imgValve_TouchUp"  IsEnabled="{Binding IsManagerPermission}"  >        <Button   Background="DarkGray" VerticalContentAlignment="Stretch" Visibility="{Binding  ElementName=GasValve,Path=IsDisableMode ,Converter={StaticResource bool2VisibilityConverter}}">        </Button>        <Image Name="imgValveOpen" Width="{Binding ElementName=GasValve,Path=Width}" Height="{Binding ElementName=GasValve,Path=Height}"/>        <Image  Name="imgValveClose" Width="{Binding ElementName=GasValve,Path=Width}" Height="{Binding ElementName=GasValve,Path=Height}"/>        <TextBlock    Text="{Binding ValveDisplayName}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="-1 0 0 0" FontFamily="Calibri" FontSize="10"  x:Name="ValveName"/>    </Grid></UserControl>
 |