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