AITHeaterInputDialogBox.xaml 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <Window x:Class="Aitex.Core.UI.DeviceControl.AITHeaterInputDialogBox"
  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. Height="265" Width="310" MaxHeight="265" MinHeight="265" MaxWidth="310" MinWidth="310" WindowStyle="ToolWindow"
  6. WindowStartupLocation="CenterOwner"
  7. KeyDown="OnEnterKeyIsHit"
  8. Title="{Binding Path=DeviceId, StringFormat={}{0} SetPoint}">
  9. <Window.Resources>
  10. <Style TargetType="Button">
  11. <Setter Property="FontSize" Value="12" />
  12. <Setter Property="Height" Value="23" />
  13. <Setter Property="HorizontalAlignment" Value="Left" />
  14. <Setter Property="VerticalAlignment" Value="Center" />
  15. <Setter Property="Width" Value="50" />
  16. </Style>
  17. <Style TargetType="Label">
  18. <Setter Property="FontFamily" Value="Arial" />
  19. <Setter Property="FontSize" Value="13" />
  20. <Setter Property="HorizontalAlignment" Value="Right" />
  21. <Setter Property="VerticalAlignment" Value="Top" />
  22. <Setter Property="Height" Value="25" />
  23. </Style>
  24. <Style x:Key="textBoxInError" TargetType="{x:Type TextBox}">
  25. <Style.Triggers>
  26. <Trigger Property="Validation.HasError" Value="true">
  27. <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
  28. </Trigger>
  29. </Style.Triggers>
  30. </Style>
  31. <my:DoubleConverter x:Key="doubleConverter"/>
  32. </Window.Resources>
  33. <Grid>
  34. <Grid.RowDefinitions>
  35. <RowDefinition/>
  36. <RowDefinition/>
  37. <RowDefinition/>
  38. <RowDefinition Height="{Binding Path=MinValueHeight}"/>
  39. <RowDefinition/>
  40. <RowDefinition/>
  41. <RowDefinition/>
  42. <RowDefinition/>
  43. </Grid.RowDefinitions>
  44. <Grid.ColumnDefinitions>
  45. <ColumnDefinition Width="1*"/>
  46. <ColumnDefinition Width="auto"/>
  47. <ColumnDefinition Width="auto"/>
  48. <ColumnDefinition Width="1*"/>
  49. </Grid.ColumnDefinitions>
  50. <Label Grid.Row="0" Grid.Column="1" Content="Device Name:" />
  51. <Label Grid.Row="1" Grid.Column="1" Content="Unit:" />
  52. <Label Grid.Row="2" Grid.Column="1" Content="Max:" />
  53. <Label Grid.Row="3" Grid.Column="1" Content="Min:" />
  54. <Label Grid.Row="4" Grid.Column="1" Content="Default:" />
  55. <Label Grid.Row="5" Grid.Column="1" Content="Feedback:" />
  56. <Label Grid.Row="6" Grid.Column="1" Content="Set Point:" />
  57. <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="Microsoft YaHei" VerticalContentAlignment="Center" />
  58. <Label Grid.Row="1" Grid.Column="2" Content="{Binding Path=Unit}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Microsoft YaHei" Height="28" VerticalContentAlignment="Center" />
  59. <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValue}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Microsoft YaHei" Height="28" VerticalContentAlignment="Center" />
  60. <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=MinValue}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Microsoft YaHei" Height="28" VerticalContentAlignment="Center" />
  61. <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=DefaultValue}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Microsoft YaHei" Height="28" VerticalContentAlignment="Center" />
  62. <Label Grid.Row="5" Grid.Column="2" Content="{Binding Path=RealValue}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Microsoft YaHei" Height="28" VerticalContentAlignment="Center" />
  63. <TextBox Grid.Row="6" Grid.Column="2" x:Name="inputBox" BorderBrush="Green" BorderThickness="0,0,0,1" Style="{StaticResource textBoxInError}" TextChanged="InputTextBox_TextChanged" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Microsoft YaHei" Height="30" VerticalContentAlignment="Center" />
  64. <StackPanel Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4" Orientation="Horizontal">
  65. <Button Content="Set" x:Name="btnSet" Click="ButtonSet_Click" Width="60" Height="26" VerticalAlignment="Top" Margin="5,3,0,0" />
  66. <Button Content="{Binding Path=HeaterOnName}" x:Name="btnHeaterOn" Click="ButtonHeaterOn_Click" Width="70" Height="26" VerticalAlignment="Top" Margin="5,3,0,0" />
  67. <Button Content="{Binding Path=HeaterOffName}" x:Name="btnHeaterOff" Click="ButtonHeaterOff_Click" Width="70" Height="26" VerticalAlignment="Top" Margin="5,3,0,0" />
  68. <Button Content="Cancel" Click="ButtonCancel_Click" Width="60" Height="26" VerticalAlignment="Top" Margin="10,3,0,0" />
  69. </StackPanel>
  70. </Grid>
  71. </Window>