AITThrottleValveInputDialogBox.xaml 7.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <Window x:Class="Aitex.Core.UI.Control.AITThrottleValveInputDialogBox"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:my="clr-namespace:Aitex.Core.UI.Control"
  5. xmlns:converters="clr-namespace:Aitex.Core.UI.Converters"
  6. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  7. Height="265" Width="280" MaxHeight="265" MinHeight="265" MaxWidth="300" MinWidth="300" WindowStyle="ToolWindow"
  8. WindowStartupLocation="CenterOwner"
  9. KeyDown="OnEnterKeyIsHit"
  10. Title="{Binding Path=DeviceId, StringFormat={}{0} SetPoint}">
  11. <Window.Resources>
  12. <Style TargetType="Button">
  13. <Setter Property="FontSize" Value="12" />
  14. <Setter Property="Height" Value="23" />
  15. <Setter Property="HorizontalAlignment" Value="Left" />
  16. <Setter Property="VerticalAlignment" Value="Center" />
  17. <Setter Property="Width" Value="50" />
  18. </Style>
  19. <Style TargetType="Label">
  20. <Setter Property="FontFamily" Value="Arial" />
  21. <Setter Property="FontSize" Value="13" />
  22. <Setter Property="HorizontalAlignment" Value="Right" />
  23. <Setter Property="VerticalAlignment" Value="Top" />
  24. <Setter Property="Height" Value="25" />
  25. </Style>
  26. <Style x:Key="textBoxInError" TargetType="{x:Type TextBox}">
  27. <Style.Triggers>
  28. <Trigger Property="Validation.HasError" Value="true">
  29. <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
  30. </Trigger>
  31. </Style.Triggers>
  32. </Style>
  33. <my:DoubleConverter x:Key="doubleConverter"/>
  34. <converters:BoolToValueConverter x:Key="BoolToValueConverter"/>
  35. </Window.Resources>
  36. <Grid>
  37. <Grid.Resources>
  38. <Style TargetType="RadioButton"/>
  39. </Grid.Resources>
  40. <Grid.RowDefinitions>
  41. <RowDefinition/>
  42. <RowDefinition/>
  43. <RowDefinition/>
  44. <RowDefinition/>
  45. <RowDefinition/>
  46. <RowDefinition/>
  47. <RowDefinition/>
  48. </Grid.RowDefinitions>
  49. <Grid.ColumnDefinitions>
  50. <ColumnDefinition Width="1*"/>
  51. <ColumnDefinition Width="auto"/>
  52. <ColumnDefinition Width="auto"/>
  53. <ColumnDefinition Width="1*"/>
  54. </Grid.ColumnDefinitions>
  55. <Label Grid.Row="0" Grid.Column="1" Content="Device Name:" />
  56. <Label Grid.Row="1" Grid.Column="1" Content="Work Mode:" />
  57. <Label Grid.Row="2" Grid.Column="1" Content="Max:" />
  58. <Label Grid.Row="3" Grid.Column="1" Content="Unit:" />
  59. <Label Grid.Row="4" Grid.Column="1" Content="Feedback:" />
  60. <Label Grid.Row="5" Grid.Column="1" Content="Set Point:" />
  61. <Label Grid.Row="0" Grid.Column="2" Content="{Binding Path=DeviceName}" Width="150" Height="28" HorizontalAlignment="Left" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" VerticalContentAlignment="Center" />
  62. <Label Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="12" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" >
  63. <StackPanel Orientation="Horizontal">
  64. <CheckBox x:Name="ckPosition" Checked="CkPosition_OnChecked" ButtonBase.Click="CkPosition_OnClick" VerticalContentAlignment="Center">Position</CheckBox>
  65. <CheckBox x:Name="ckPressure" Checked="CkPressure_OnChecked" ButtonBase.Click="CkPressure_OnClick" Margin="10,0,0,0" VerticalContentAlignment="Center">Pressure</CheckBox>
  66. </StackPanel>
  67. </Label>
  68. <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValuePosition}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  69. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  70. <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValuePressure}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  71. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  72. <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=UnitPosition}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  73. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  74. <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=UnitPressure}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  75. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  76. <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=FeedbackPosition}" ContentStringFormat="F1" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  77. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  78. <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=FeedbackPressure}" ContentStringFormat="F1" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  79. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  80. <TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBoxPosition" BorderBrush="Green" BorderThickness="0,0,0,1" Style="{StaticResource textBoxInError}" Padding="3,0,0,0"
  81. TextChanged="InputTextBoxPosition_TextChanged" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center"
  82. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  83. <TextBox Grid.Row="5" Grid.Column="2" x:Name="inputBoxPressure" BorderBrush="Green" BorderThickness="0,0,0,1" Style="{StaticResource textBoxInError}" Padding="3,0,0,0"
  84. TextChanged="InputTextBoxPressure_TextChanged" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center"
  85. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  86. <Button Grid.Row="6" Grid.ColumnSpan="2" Content="Set" x:Name="buttonSet" Click="ButtonSet_Click" Width="80" Height="26" VerticalAlignment="Top" Grid.Column="1" Margin="5,3,0,0" />
  87. <Button Grid.Row="6" Grid.Column="2" Content="Cancel" Click="ButtonCancel_Click" Width="80" Height="26" VerticalAlignment="Top" Margin="44,3,0,0" />
  88. </Grid>
  89. </Window>