1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <UserControl x:Class="Aitex.Core.UI.DeviceControl.AITGasIIValve"
- 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"
- xmlns:converters1="clr-namespace:MECF.Framework.UI.Core.Converters"
- mc:Ignorable="d"
- Height="32" Width="32" Loaded="AITGasIIValve_OnLoaded"
- Name="GasIIValve">
- <UserControl.Resources>
- <converters1:BoolToBrushConverter x:Key="boolToBrushConverter"></converters1:BoolToBrushConverter>
- <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="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=GasIIValve,Path=Width,Converter={StaticResource transformConvert}}"
- CenterY="{Binding ElementName=GasIIValve,Path=Height,Converter={StaticResource transformConvert}}"/>
- </UserControl.RenderTransform>
- <Grid MouseLeftButtonUp="imgValveClose_MouseLeftButtonUp" TouchUp="imgValve_TouchUp" IsEnabled="{Binding IsManagerPermission}">
- <Image Name="imgValveOpen" Width="{Binding ElementName=GasIIValve,Path=Width}" Height="{Binding ElementName=GasIIValve,Path=Height}"/>
- <Image Name="imgValveClose" Width="{Binding ElementName=GasIIValve,Path=Width}" Height="{Binding ElementName=GasIIValve,Path=Height}"/>
- <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"/>
- <Border BorderThickness="2" BorderBrush="Gray" Visibility="{Binding ElementName=GasIIValve,Path=IsDisableMode ,Converter={StaticResource bool2VisibilityConverter}}">
- </Border>
- </Grid>
- </UserControl>
|