ProductParams.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <UserControl x:Class="TeamAAS_VP.Views.Product.ProductParams"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  6. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  7. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  8. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  9. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  10. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  11. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  12. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Product"
  13. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  14. lex:LocalizeDictionary.DesignCulture="zh-CN"
  15. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  16. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. mc:Ignorable="d"
  19. d:DataContext="{d:DesignInstance Type=vm:ProductParamsViewModel}"
  20. d:Height="600"
  21. d:Width="1024"
  22. d:Background="White"
  23. FontFamily="{DynamicResource DefaultFont}">
  24. <b:Interaction.Triggers>
  25. <b:EventTrigger EventName="Loaded">
  26. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  27. </b:EventTrigger>
  28. </b:Interaction.Triggers>
  29. <Grid>
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="auto" />
  32. <RowDefinition Height="*" />
  33. <RowDefinition Height="auto" />
  34. </Grid.RowDefinitions>
  35. <Button Grid.Row="0"
  36. Content="{materialDesign:PackIcon Kind=ArrowLeftCircle}"
  37. Width="50"
  38. HorizontalAlignment="Left"
  39. VerticalAlignment="Top"
  40. ToolTip="{lex:Loc 返回}"
  41. Style="{StaticResource MaterialDesignIconButton}"
  42. Command="{Binding BackCommand}" />
  43. <StackPanel Grid.Row="0"
  44. Orientation="Horizontal"
  45. Margin="50,0"
  46. VerticalAlignment="Center">
  47. <materialDesign:PackIcon Kind="CubeOutline"
  48. Width="30"
  49. Height="30" />
  50. <TextBlock Text="{Binding SelectProduct.Name}"
  51. VerticalAlignment="Center" />
  52. <TextBlock Text="{lex:Loc 产品参数,Converter={StaticResource StringFormatConverter},ConverterParameter=' - {0}'}"
  53. VerticalAlignment="Center" />
  54. </StackPanel>
  55. <Border BorderThickness="1,1,1,1"
  56. VerticalAlignment="Bottom"
  57. Height="1">
  58. <Border.BorderBrush>
  59. <VisualBrush>
  60. <VisualBrush.Visual>
  61. <Rectangle StrokeDashArray="4 4"
  62. Stroke="LightGray"
  63. StrokeThickness="1"
  64. Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
  65. Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}" />
  66. </VisualBrush.Visual>
  67. </VisualBrush>
  68. </Border.BorderBrush>
  69. </Border>
  70. <materialDesign:DrawerHost Grid.Row="1"
  71. OpenMode="Standard"
  72. x:Name="DrawerHost"
  73. IsEnabled="{Binding IsAllowEdit}">
  74. <materialDesign:DrawerHost.RightDrawerContent>
  75. <uControl:ParameterEdit x:Name="parameterEdit"/>
  76. </materialDesign:DrawerHost.RightDrawerContent>
  77. <Grid>
  78. <Grid.ColumnDefinitions>
  79. <ColumnDefinition Width="auto" />
  80. <ColumnDefinition Width="*" />
  81. </Grid.ColumnDefinitions>
  82. <Expander Grid.Column="0"
  83. ExpandDirection="Right"
  84. Background="Transparent">
  85. <Expander.Header>
  86. <TextBlock RenderTransformOrigin=".5,.5"
  87. Text="Navigation Description">
  88. <TextBlock.LayoutTransform>
  89. <RotateTransform Angle="90" />
  90. </TextBlock.LayoutTransform>
  91. </TextBlock>
  92. </Expander.Header>
  93. <ScrollViewer>
  94. <StackPanel Margin="8,24,16,24"
  95. Orientation="Vertical">
  96. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/10产品参数.png"
  97. Stretch="Uniform"
  98. Width="350"
  99. HorizontalAlignment="Center"
  100. VerticalAlignment="Top" />
  101. <TextBlock Text="{lex:Loc 产品参数设定}" />
  102. <TextBlock Foreground="Gray"
  103. TextWrapping="Wrap"
  104. Text="{lex:Loc 产品参数设定描述}" />
  105. </StackPanel>
  106. </ScrollViewer>
  107. </Expander>
  108. <Grid Grid.Column="1"
  109. IsEnabled="{Binding IsAllowEdit}"
  110. Margin="10"
  111. HorizontalAlignment="Center"
  112. VerticalAlignment="Center">
  113. <Grid.RowDefinitions>
  114. <RowDefinition Height="auto" />
  115. <RowDefinition Height="auto" />
  116. <RowDefinition Height="auto" />
  117. <RowDefinition Height="auto" />
  118. <RowDefinition Height="auto" />
  119. <RowDefinition Height="auto" />
  120. </Grid.RowDefinitions>
  121. <Grid.ColumnDefinitions>
  122. <ColumnDefinition Width="auto" />
  123. <ColumnDefinition Width="auto" />
  124. </Grid.ColumnDefinitions>
  125. <Grid.Resources>
  126. <Style TargetType="TextBlock">
  127. <Setter Property="HorizontalAlignment"
  128. Value="Right" />
  129. <Setter Property="VerticalAlignment"
  130. Value="Center" />
  131. <Setter Property="FontSize"
  132. Value="10" />
  133. <Setter Property="FontWeight"
  134. Value="Bold" />
  135. <Setter Property="Margin"
  136. Value="5,2" />
  137. </Style>
  138. <Style TargetType="TextBox"
  139. BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
  140. <Setter Property="HorizontalAlignment"
  141. Value="Center" />
  142. <Setter Property="VerticalAlignment"
  143. Value="Center" />
  144. <Setter Property="FontSize"
  145. Value="10" />
  146. <Setter Property="Margin"
  147. Value="5,2" />
  148. <Setter Property="MinWidth"
  149. Value="100" />
  150. <Setter Property="HorizontalContentAlignment"
  151. Value="Center" />
  152. <Setter Property="VerticalContentAlignment"
  153. Value="Center" />
  154. </Style>
  155. </Grid.Resources>
  156. <ToggleButton Grid.Column="1"
  157. Grid.Row="0"
  158. HorizontalAlignment="Right"
  159. VerticalAlignment="Top"
  160. materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ChevronDoubleLeft}"
  161. Content="{materialDesign:PackIcon Kind=ChevronDoubleRight}"
  162. Style="{StaticResource MaterialDesignActionToggleButton}"
  163. ToolTip="{lex:Loc 其他参数}"
  164. Margin="0,-40"
  165. IsChecked="{Binding IsRightDrawerOpen,ElementName=DrawerHost}" />
  166. <!--PTP速度-->
  167. <TextBlock Grid.Row="0"
  168. Grid.Column="0"
  169. Text="{lex:Loc PTP速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  170. <mah:NumericUpDown Grid.Row="0"
  171. Grid.Column="1"
  172. Margin="0,5"
  173. Maximum="100"
  174. Minimum="1"
  175. StringFormat="{}{0:N0} %"
  176. Value="{Binding SelectProduct.Speed,Mode=TwoWay}" />
  177. <!--PTP加减速度-->
  178. <TextBlock Grid.Row="1"
  179. Grid.Column="0"
  180. Text="{lex:Loc PTP加减速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  181. <mah:NumericUpDown Grid.Row="1"
  182. Grid.Column="1"
  183. Margin="0,5"
  184. Maximum="100"
  185. Minimum="1"
  186. StringFormat="{}{0:N0} %"
  187. Value="{Binding SelectProduct.Accel,Mode=TwoWay}" />
  188. <!--CP速度-->
  189. <TextBlock Grid.Row="2"
  190. Grid.Column="0"
  191. Text="{lex:Loc CP速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  192. <mah:NumericUpDown Grid.Row="2"
  193. Grid.Column="1"
  194. Margin="0,5"
  195. Maximum="3000"
  196. Minimum="1"
  197. StringFormat="{}{0:N0} mm/s"
  198. Value="{Binding SelectProduct.Speeds,Mode=TwoWay}" />
  199. <!--CP加减速度-->
  200. <TextBlock Grid.Row="3"
  201. Grid.Column="0"
  202. Text="{lex:Loc CP加减速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  203. <mah:NumericUpDown Grid.Row="3"
  204. Grid.Column="1"
  205. Margin="0,5"
  206. Maximum="30000"
  207. Minimum="1"
  208. StringFormat="{}{0:N0} mm/s²"
  209. Value="{Binding SelectProduct.Accels,Mode=TwoWay}" />
  210. <!--功率-->
  211. <TextBlock Grid.Row="4"
  212. Grid.Column="0"
  213. Text="{lex:Loc 功率,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  214. <CheckBox Grid.Row="4"
  215. Grid.Column="1"
  216. Content="{lex:Loc 高功率}"
  217. IsChecked="{Binding SelectProduct.Power}" />
  218. <!--二次相机功能-->
  219. <TextBlock Grid.Row="5"
  220. Grid.Column="0"
  221. Text="{lex:Loc 视觉引导模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  222. <CheckBox Grid.Row="5"
  223. Grid.Column="1"
  224. Content="{lex:Loc 启用二次定位相机}"
  225. IsChecked="{Binding SelectProduct.IsUserUpCamera}" />
  226. </Grid>
  227. </Grid>
  228. </materialDesign:DrawerHost>
  229. <StackPanel Grid.Row="2"
  230. Orientation="Horizontal"
  231. HorizontalAlignment="Center"
  232. VerticalAlignment="Center"
  233. Margin="20">
  234. <Button Content="{lex:Loc 完成}"
  235. IsEnabled="{Binding IsAllowEdit}"
  236. MinWidth="100"
  237. HorizontalAlignment="Center"
  238. VerticalAlignment="Center"
  239. materialDesign:ButtonAssist.CornerRadius="10"
  240. Style="{StaticResource MaterialDesignRaisedButton}"
  241. Command="{Binding NextCommand}" />
  242. </StackPanel>
  243. </Grid>
  244. </UserControl>