AITBoostPumpInputDialogBox.xaml 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <Window x:Class="Aitex.Core.UI.DeviceControl.AITBoostPumpInputDialogBox"
  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/>
  39. <RowDefinition/>
  40. <RowDefinition/>
  41. <RowDefinition/>
  42. </Grid.RowDefinitions>
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition Width="1*"/>
  45. <ColumnDefinition Width="auto"/>
  46. <ColumnDefinition Width="auto"/>
  47. <ColumnDefinition Width="1*"/>
  48. </Grid.ColumnDefinitions>
  49. <Label Grid.Row="0" Grid.Column="1" Content="Device Name:" />
  50. <Label Grid.Row="1" Grid.Column="1" Content="Unit:" />
  51. <Label Grid.Row="2" Grid.Column="1" Content="Max:" />
  52. <Label Grid.Row="3" Grid.Column="1" Content="Frequency:" />
  53. <Label Grid.Row="4" Grid.Column="1" Content="CurrentSetPoint:" />
  54. <Label Grid.Row="5" Grid.Column="1" Content="Set Pressure:" />
  55. <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" />
  56. <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" />
  57. <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" />
  58. <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=Frequency}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Microsoft YaHei" Height="28" VerticalContentAlignment="Center" />
  59. <Label Grid.Row="4" 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" />
  60. <TextBox Grid.Row="5" 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" />
  61. <StackPanel Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Center">
  62. <Button Content="Set" x:Name="btnSet" Click="ButtonSet_Click" Width="60" Height="26" VerticalAlignment="Top" Margin="5,3,0,0" />
  63. <Button Content="Cancel" Click="ButtonCancel_Click" Width="60" Height="26" VerticalAlignment="Top" Margin="50,3,0,0" />
  64. </StackPanel>
  65. </Grid>
  66. </Window>