AflexControl.xaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <UserControl x:Class="TeamAAS_VP.Controls.AflexControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:TeamAAS_VP.Controls"
  7. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  8. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  9. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  11. lex:LocalizeDictionary.DesignCulture="zh-CN"
  12. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  13. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  14. mc:Ignorable="d"
  15. d:DesignHeight="450"
  16. d:DesignWidth="800"
  17. d:Background="White"
  18. FontFamily="{DynamicResource DefaultFont}">
  19. <Grid Margin="20">
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="auto" />
  22. <RowDefinition Height="auto" />
  23. <RowDefinition Height="auto" />
  24. <RowDefinition Height="auto" />
  25. </Grid.RowDefinitions>
  26. <Grid.ColumnDefinitions>
  27. <ColumnDefinition Width="auto" />
  28. <ColumnDefinition Width="auto" />
  29. <ColumnDefinition Width="auto" />
  30. </Grid.ColumnDefinitions>
  31. <Grid.Resources>
  32. <Style TargetType="TextBlock">
  33. <Setter Property="HorizontalAlignment"
  34. Value="Right" />
  35. <Setter Property="VerticalAlignment"
  36. Value="Center" />
  37. <Setter Property="Margin"
  38. Value="10,0" />
  39. <Setter Property="Grid.Column"
  40. Value="0" />
  41. </Style>
  42. <Style TargetType="Button"
  43. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  44. <Setter Property="Margin"
  45. Value="10,5" />
  46. <Setter Property="HorizontalAlignment"
  47. Value="Center" />
  48. <Setter Property="VerticalAlignment"
  49. Value="Center" />
  50. <Setter Property="Grid.Column"
  51. Value="2" />
  52. </Style>
  53. <Style TargetType="mah:NumericUpDown">
  54. <Setter Property="HorizontalAlignment"
  55. Value="Center" />
  56. <Setter Property="VerticalAlignment"
  57. Value="Center" />
  58. <Setter Property="Grid.Column"
  59. Value="1" />
  60. </Style>
  61. </Grid.Resources>
  62. <!--选择配置-->
  63. <TextBlock Grid.Row="0"
  64. Text="{lex:Loc 选择配置,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  65. <ComboBox Grid.Row="0"
  66. Grid.Column="1"
  67. MinWidth="60"
  68. SelectedIndex="{Binding ConfigIndex}"
  69. materialDesign:HintAssist.Hint="{lex:Loc 配置编号}">
  70. <ComboBoxItem>
  71. <TextBlock Text="1|Flip"
  72. VerticalAlignment="Center" />
  73. </ComboBoxItem>
  74. <ComboBoxItem>
  75. <TextBlock Text="2|Move"
  76. VerticalAlignment="Center" />
  77. </ComboBoxItem>
  78. <ComboBoxItem>
  79. <TextBlock Text="3|Flip"
  80. VerticalAlignment="Center" />
  81. </ComboBoxItem>
  82. <ComboBoxItem>
  83. <TextBlock Text="4|Move"
  84. VerticalAlignment="Center" />
  85. </ComboBoxItem>
  86. <ComboBoxItem>
  87. <TextBlock Text="5|"
  88. VerticalAlignment="Center" />
  89. </ComboBoxItem>
  90. <ComboBoxItem>
  91. <TextBlock Text="6|"
  92. VerticalAlignment="Center" />
  93. </ComboBoxItem>
  94. <ComboBoxItem>
  95. <TextBlock Text="7|"
  96. VerticalAlignment="Center" />
  97. </ComboBoxItem>
  98. <ComboBoxItem>
  99. <TextBlock Text="8|"
  100. VerticalAlignment="Center" />
  101. </ComboBoxItem>
  102. <ComboBoxItem>
  103. <TextBlock Text="9|"
  104. VerticalAlignment="Center" />
  105. </ComboBoxItem>
  106. <ComboBoxItem>
  107. <TextBlock Text="10|"
  108. VerticalAlignment="Center" />
  109. </ComboBoxItem>
  110. <ComboBoxItem>
  111. <TextBlock Text="11|"
  112. VerticalAlignment="Center" />
  113. </ComboBoxItem>
  114. <ComboBoxItem>
  115. <TextBlock Text="12|"
  116. VerticalAlignment="Center" />
  117. </ComboBoxItem>
  118. <ComboBoxItem>
  119. <TextBlock Text="13|"
  120. VerticalAlignment="Center" />
  121. </ComboBoxItem>
  122. </ComboBox>
  123. <Button Grid.Row="0"
  124. Content="{lex:Loc 确定}"
  125. Command="{Binding ActionCommand}"
  126. CommandParameter="1"/>
  127. <!--强度-->
  128. <TextBlock Grid.Row="1"
  129. Text="{lex:Loc 振动强度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  130. <mah:NumericUpDown Grid.Row="1"
  131. Maximum="100"
  132. Minimum="0"
  133. Interval="0.1"
  134. materialDesign:HintAssist.Hint="{lex:Loc 振动强度}"
  135. StringFormat="{}{0:N1} %"
  136. Value="{Binding Intensity,Mode=TwoWay}"/>
  137. <Button Grid.Row="1"
  138. Content="{lex:Loc 确定}"
  139. Command="{Binding ActionCommand}"
  140. CommandParameter="2" />
  141. <!--方向-->
  142. <TextBlock Grid.Row="2"
  143. Text="{lex:Loc 振动方向,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  144. <mah:NumericUpDown Grid.Row="2"
  145. Maximum="360"
  146. Minimum="0"
  147. Interval="0.1"
  148. materialDesign:HintAssist.Hint="{lex:Loc 振动方向}"
  149. StringFormat="{}{0:N1} °"
  150. Value="{Binding Direction,Mode=TwoWay}" />
  151. <Button Grid.Row="2"
  152. Content="{lex:Loc 确定}"
  153. Command="{Binding ActionCommand}"
  154. CommandParameter="3" />
  155. <!--背光亮度-->
  156. <TextBlock Grid.Row="3"
  157. Text="{lex:Loc 背光亮度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  158. <mah:NumericUpDown Grid.Row="3"
  159. Maximum="100"
  160. Minimum="0"
  161. Interval="0.1"
  162. materialDesign:HintAssist.Hint="{lex:Loc 背光亮度}"
  163. StringFormat="{}{0:N1} %"
  164. Value="{Binding Backlight,Mode=TwoWay}" />
  165. <Button Grid.Row="3"
  166. Content="{lex:Loc 确定}"
  167. Command="{Binding ActionCommand}"
  168. CommandParameter="4" />
  169. </Grid>
  170. </UserControl>