123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <UserControl x:Class="Aitex.Core.UI.DeviceControl.AITTurboPump"
- 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:converters="clr-namespace:Aitex.Core.UI.Converters"
- mc:Ignorable="d" x:Name="Self" >
- <UserControl.Resources>
- <converters:bool2VisibilityConverter x:Key="Bool2VisibilityConvert"/>
- </UserControl.Resources>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="110"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Image Grid.Column="0" Width="50" Height="70" x:Name="imagePicture" Source="/MECF.Framework.Common;component/Resources/Pump/TurboPump/pump_off.png" >
- <Image.ContextMenu>
- <ContextMenu Visibility="{Binding ElementName=Self, Path=EnableControl,Converter= {StaticResource Bool2VisibilityConvert}, Mode=OneWay}">
- <MenuItem Header="ON" IsEnabled="{Binding ElementName=Self, Path=EnableControl,Mode=OneWay}" Click="PumpOn"/>
- <MenuItem Header="OFF" IsEnabled="{Binding ElementName=Self, Path=EnableControl,Mode=OneWay}" Click="PumpOff" />
- </ContextMenu>
- </Image.ContextMenu>
- </Image>
- <Border Grid.Row="0" Width="50" Height="60" >
- <TextBlock x:Name="txtState" Text="OFF" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="9" FontWeight="Bold" Margin="9,0,10,37" Width="31" />
- </Border>
- <StackPanel Grid.Row="2" HorizontalAlignment="Center"
- Visibility="{Binding ElementName=Self, Path=IsShowSpeed,Converter= {StaticResource Bool2VisibilityConvert}, Mode=OneWay}">
- <Border BorderBrush="black" Height="19" BorderThickness="1,1,1,1">
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
- <Border BorderBrush="black" BorderThickness="0,0,1,0" Background="DarkGray" >
- <TextBlock Text="Speed:" Width="46" Padding="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Right"/>
- </Border>
- <TextBlock x:Name="txtSpeed" Text="{Binding ElementName=Self, Path=DeviceData.Speed, Mode=OneWay}"
- FontWeight="Bold" VerticalAlignment="Stretch" Width="45" Padding="8,0,5,0"/>
- </StackPanel>
- </Border>
- </StackPanel>
- </Grid>
- </UserControl>
|