AITRfInputDialogBox.xaml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <Window x:Class="Aitex.Core.UI.Control.AITRfInputDialogBox"
  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="355" Width="260" MaxHeight="355" MinHeight="355" MaxWidth="300" MinWidth="300" 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 Margin="0">
  34. <Grid.RowDefinitions>
  35. <RowDefinition/>
  36. <RowDefinition Height="{Binding GridLengthWorkMode}"/>
  37. <RowDefinition Height="{Binding GridLengthWorkMode}"/>
  38. <RowDefinition Height="{Binding GridLengthWorkMode}"/>
  39. <RowDefinition/>
  40. <RowDefinition/>
  41. <RowDefinition Height="{Binding GridLengthReflect}"/>
  42. <RowDefinition Height="{Binding GridLengthVoltageCurrent}"/>
  43. <RowDefinition Height="{Binding GridLengthVoltageCurrent}"/>
  44. <RowDefinition/>
  45. <RowDefinition/>
  46. </Grid.RowDefinitions>
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="1*"/>
  49. <ColumnDefinition Width="auto"/>
  50. <ColumnDefinition Width="auto"/>
  51. <ColumnDefinition Width="1*"/>
  52. </Grid.ColumnDefinitions>
  53. <Label Grid.Row="0" Grid.Column="1" Content="Device Name:" />
  54. <Label Grid.Row="1" Grid.Column="1" Content="WorkMode:" />
  55. <Label Grid.Row="2" Grid.Column="1" Content="Pulsing Frequency:" x:Name="lblFrequency"/>
  56. <Label Grid.Row="3" Grid.Column="1" Content="Pulsing Duty:" x:Name="lblDuty"/>
  57. <Label Grid.Row="4" Grid.Column="1" Content="Max:" />
  58. <Label Grid.Row="5" Grid.Column="1" Content="Forward Power:" />
  59. <Label Grid.Row="6" Grid.Column="1" Content="Reflect Power:" />
  60. <Label Grid.Row="7" Grid.Column="1" Content="Voltage:" />
  61. <Label Grid.Row="8" Grid.Column="1" Content="Current:" />
  62. <Label Grid.Row="9" Grid.Column="1" Content="Set Point:" />
  63. <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" />
  64. <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" >
  65. <StackPanel Orientation="Horizontal">
  66. <CheckBox x:Name="ckContinuous" Checked="CkContinuous_OnChecked" ButtonBase.Click="CkContinuous_OnClick" VerticalContentAlignment="Center">Continuous</CheckBox>
  67. <CheckBox x:Name="ckPulsing" Checked="CkPulsing_OnChecked" ButtonBase.Click="CkPulsing_OnClick" Margin="10,0,0,0" VerticalContentAlignment="Center">Pulsing</CheckBox>
  68. </StackPanel>
  69. </Label>
  70. <TextBox Grid.Row="2" Grid.Column="2" x:Name="inputBoxFrequency" BorderBrush="Green" BorderThickness="0,0,0,1" Style="{StaticResource textBoxInError}" TextChanged="InputTextBoxFrequency_TextChanged" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center" />
  71. <TextBox Grid.Row="3" Grid.Column="2" x:Name="inputBoxDuty" BorderBrush="Green" BorderThickness="0,0,0,1" Style="{StaticResource textBoxInError}" TextChanged="InputTextBoxDuty_TextChanged" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center" />
  72. <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=MaxValuePower, StringFormat={}{0:F1}}" ContentStringFormat="{}{0:F2}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
  73. <Label Grid.Row="5" Grid.Column="2" Content="{Binding Path=ForwardPower, StringFormat={}{0:F1}}" ContentStringFormat="{}{0:F2}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
  74. <Label Grid.Row="6" Grid.Column="2" Content="{Binding Path=ReflectPower, StringFormat={}{0:F1}}" ContentStringFormat="{}{0:F2}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
  75. <Label Grid.Row="7" Grid.Column="2" Content="{Binding Path=Voltage, StringFormat={}{0:F1}}" ContentStringFormat="{}{0:F2}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
  76. <Label Grid.Row="8" Grid.Column="2" Content="{Binding Path=Current, StringFormat={}{0:F1}}" ContentStringFormat="{}{0:F2}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" />
  77. <TextBox Grid.Row="9" Grid.Column="2" x:Name="inputBoxPower" BorderBrush="Green" BorderThickness="0,0,0,1" Style="{StaticResource textBoxInError}" TextChanged="InputTextBoxPower_TextChanged" Width="150" HorizontalAlignment="Left" FontSize="13" FontFamily="Arial,SimSun" Height="30" VerticalContentAlignment="Center" />
  78. <Button Grid.Row="10" Grid.ColumnSpan="2" Content="Set" x:Name="buttonSet" Click="ButtonSet_Click" Width="60" Height="23" VerticalAlignment="Top" Grid.Column="1" Margin="5,3,0,0" />
  79. <Button Grid.Row="10" Grid.ColumnSpan="2" Content="PowerOn" x:Name="buttonRFOn" Click="ButtonRFOn_Click" Width="60" Height="23" VerticalAlignment="Top" Grid.Column="1" Margin="76,3,0,0" />
  80. <Button Grid.Row="10" Content="PowerOff" x:Name="buttonRFOff" Click="ButtonRFOff_Click" Width="60" Height="23" VerticalAlignment="Top" Grid.Column="2" Margin="17,3,0,0" />
  81. <Button Grid.Row="10" Grid.Column="2" Content="Cancel" Click="ButtonCancel_Click" Width="60" Height="23" VerticalAlignment="Top" Margin="86,3,0,0" />
  82. </Grid>
  83. </Window>