AITThrottleValveInputDialogBox.xaml 7.6 KB

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