AITTurboPump.xaml 2.8 KB

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