InputDialogBox.xaml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <Window
  2. x:Class="Aitex.Core.UI.Control.InputDialogBox"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:my="clr-namespace:Aitex.Core.UI.Control"
  6. Title="{Binding DeviceTitle}"
  7. Width="260"
  8. MinWidth="300"
  9. MinHeight="265"
  10. MaxWidth="300"
  11. KeyDown="OnEnterKeyIsHit"
  12. SizeToContent="Height"
  13. WindowStartupLocation="CenterOwner"
  14. WindowStyle="ToolWindow">
  15. <Window.Resources>
  16. <Style TargetType="Button">
  17. <Setter Property="FontSize" Value="12" />
  18. <Setter Property="Height" Value="23" />
  19. <Setter Property="HorizontalAlignment" Value="Left" />
  20. <Setter Property="VerticalAlignment" Value="Center" />
  21. <Setter Property="Width" Value="50" />
  22. </Style>
  23. <Style TargetType="Label">
  24. <Setter Property="FontFamily" Value="Arial,SimSun" />
  25. <Setter Property="FontSize" Value="13" />
  26. <Setter Property="HorizontalAlignment" Value="Right" />
  27. <Setter Property="VerticalAlignment" Value="Top" />
  28. <Setter Property="Height" Value="25" />
  29. </Style>
  30. <my:DoubleConverter x:Key="doubleConverter" />
  31. </Window.Resources>
  32. <Grid>
  33. <Grid.RowDefinitions>
  34. <RowDefinition MinHeight="35" />
  35. <RowDefinition MinHeight="35" />
  36. <RowDefinition MinHeight="35" />
  37. <RowDefinition MinHeight="35" />
  38. <RowDefinition Height="0" />
  39. <RowDefinition MinHeight="35" />
  40. <RowDefinition Height="Auto" />
  41. <RowDefinition Height="45" />
  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
  50. Grid.Row="0"
  51. Grid.Column="1"
  52. Content="DeviceName" />
  53. <Label
  54. Grid.Row="1"
  55. Grid.Column="1"
  56. Content="Unit" />
  57. <Label
  58. Grid.Row="2"
  59. Grid.Column="1"
  60. Content="Max" />
  61. <Label
  62. Grid.Row="3"
  63. Grid.Column="1"
  64. Content="Default" />
  65. <Label
  66. Grid.Row="4"
  67. Grid.Column="1"
  68. Content="Feedback" />
  69. <Label
  70. Grid.Row="5"
  71. Grid.Column="1"
  72. Content="SetPoint" />
  73. <Label
  74. Grid.Row="6"
  75. Grid.Column="1"
  76. Content="Ramp"
  77. Visibility="{Binding RampVisibility}" />
  78. <Label
  79. Grid.Row="0"
  80. Grid.Column="2"
  81. Width="150"
  82. Height="28"
  83. HorizontalAlignment="Left"
  84. VerticalContentAlignment="Center"
  85. BorderBrush="Black"
  86. BorderThickness="0,0,0,1"
  87. Content="{Binding Path=DeviceName}"
  88. FontFamily="Arial,SimSun"
  89. FontSize="13" />
  90. <Label
  91. Grid.Row="1"
  92. Grid.Column="2"
  93. Width="150"
  94. Height="28"
  95. VerticalContentAlignment="Center"
  96. BorderBrush="Black"
  97. BorderThickness="0,0,0,1"
  98. Content="{Binding Path=Unit}"
  99. FontFamily="Arial,SimSun"
  100. FontSize="13" />
  101. <Label
  102. Grid.Row="2"
  103. Grid.Column="2"
  104. Width="150"
  105. Height="28"
  106. VerticalContentAlignment="Center"
  107. BorderBrush="Black"
  108. BorderThickness="0,0,0,1"
  109. Content="{Binding Path=MaxValue}"
  110. ContentStringFormat="F1"
  111. FontFamily="Arial,SimSun"
  112. FontSize="13" />
  113. <Label
  114. Grid.Row="3"
  115. Grid.Column="2"
  116. Width="150"
  117. Height="28"
  118. VerticalContentAlignment="Center"
  119. BorderBrush="Black"
  120. BorderThickness="0,0,0,1"
  121. Content="{Binding Path=DefaultValue}"
  122. FontFamily="Arial,SimSun"
  123. FontSize="13" />
  124. <Label
  125. Grid.Row="4"
  126. Grid.Column="2"
  127. Width="150"
  128. Height="28"
  129. VerticalContentAlignment="Center"
  130. BorderBrush="Black"
  131. BorderThickness="0,0,0,1"
  132. Content="{Binding Path=RealValue}"
  133. FontFamily="Arial,SimSun"
  134. FontSize="13" />
  135. <TextBox
  136. x:Name="inputBox"
  137. Grid.Row="5"
  138. Grid.Column="2"
  139. Width="150"
  140. Height="30"
  141. HorizontalAlignment="Left"
  142. VerticalContentAlignment="Center"
  143. BorderThickness="0,0,0,1"
  144. FontFamily="Arial,SimSun"
  145. FontSize="13"
  146. Style="{DynamicResource Err_TextBox}"
  147. Tag="{Binding Path=TagName}"
  148. TextChanged="InputTextBox_TextChanged" />
  149. <Grid
  150. Grid.Row="6"
  151. Grid.Column="2"
  152. MinHeight="35"
  153. Visibility="{Binding RampVisibility}">
  154. <TextBox
  155. x:Name="inputRampBox"
  156. Width="150"
  157. Height="30"
  158. HorizontalAlignment="Left"
  159. VerticalContentAlignment="Center"
  160. BorderThickness="0,0,0,1"
  161. FontFamily="Arial,SimSun"
  162. FontSize="13"
  163. Style="{DynamicResource Err_TextBox}"
  164. Tag="{Binding Path=TagName}"
  165. TextChanged="inputRampBox_TextChanged" />
  166. </Grid>
  167. <StackPanel
  168. Grid.Row="7"
  169. Grid.ColumnSpan="4"
  170. HorizontalAlignment="Center"
  171. Orientation="Horizontal">
  172. <Button
  173. x:Name="buttonSet"
  174. Width="120"
  175. Height="35"
  176. Margin="0,3,5,0"
  177. VerticalAlignment="Top"
  178. Click="ButtonSet_Click"
  179. Content="Set"
  180. PreviewTouchUp="button_PreviewTouchUp"
  181. Stylus.IsTouchFeedbackEnabled="False" />
  182. <Button
  183. Grid.Column="1"
  184. Width="120"
  185. Height="35"
  186. Margin="5,3,0,0"
  187. VerticalAlignment="Top"
  188. Click="ButtonCancel_Click"
  189. Content="Cancel"
  190. PreviewTouchUp="button_PreviewCancelTouchUp"
  191. Stylus.IsTouchFeedbackEnabled="False" />
  192. </StackPanel>
  193. </Grid>
  194. </Window>