InputDialogBox.xaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <Window x:Class="MECF.Framework.UI.Client.Ctrlib.UnitControls.InputDialogBox"
  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:MECF.Framework.UI.Client.Ctrlib.UnitControls"
  5. Height="265" Width="260" MaxHeight="265" MinHeight="265" MaxWidth="300" MinWidth="300" WindowStyle="ToolWindow"
  6. WindowStartupLocation="CenterOwner"
  7. KeyDown="OnEnterKeyIsHit"
  8. Title="{Binding DeviceTitle}">
  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,SimSun" />
  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="DeviceName" />
  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="Default" />
  53. <Label Grid.Row="4" Grid.Column="1" Content="Feedback" />
  54. <Label Grid.Row="5" Grid.Column="1" Content="SetPoint" />
  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="Arial,SimSun" 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="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
  57. <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=MaxValue}" ContentStringFormat="F1" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
  58. <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=DefaultValue}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" 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="Arial,SimSun" 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="Arial,SimSun" Height="30" VerticalContentAlignment="Center" />
  61. <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" />
  62. <Button Grid.Row="6" Grid.Column="2" Content="Cancel" Click="ButtonCancel_Click" Width="80" Height="26" VerticalAlignment="Top" Margin="44,3,0,0" />
  63. </Grid>
  64. </Window>