OtherControl.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <UserControl
  2. x:Class="SHJX.Service.Librarys.setting.OtherControl"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:SHJX.Service.Librarys.setting"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:pu="clr-namespace:Panuon.UI.Silver;assembly=Panuon.UI.Silver"
  9. x:Name="otherSetting"
  10. d:DesignHeight="800"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <ResourceDictionary>
  15. <ResourceDictionary.MergedDictionaries>
  16. <ResourceDictionary Source="pack://application:,,,/Panuon.UI.Silver;component/Control.xaml" />
  17. </ResourceDictionary.MergedDictionaries>
  18. <!--#region 下面这段代码不用,不能变成Uniform的样式-->
  19. <Style x:Key="ItemContainerStyle" TargetType="{x:Type ListViewItem}">
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate TargetType="{x:Type ListViewItem}">
  23. <Border
  24. x:Name="Bd"
  25. Background="Transparent"
  26. BorderBrush="Transparent"
  27. BorderThickness="0">
  28. <ContentPresenter />
  29. </Border>
  30. <ControlTemplate.Triggers>
  31. <Trigger Property="IsSelected" Value="true">
  32. <Setter TargetName="Bd" Property="Background" Value="Transparent" />
  33. </Trigger>
  34. </ControlTemplate.Triggers>
  35. </ControlTemplate>
  36. </Setter.Value>
  37. </Setter>
  38. </Style>
  39. <!-- endregion -->
  40. <!--#region 速度控件DataTemplate-->
  41. <DataTemplate x:Key="SpeedTemplate">
  42. <Viewbox Margin="3,0">
  43. <Grid>
  44. <GroupBox
  45. Name="gb_speed"
  46. HorizontalAlignment="Center"
  47. VerticalAlignment="Center"
  48. pu:GroupBoxHelper.CornerRadius="8"
  49. pu:GroupBoxHelper.IsSplitLineVisible="True"
  50. pu:GroupBoxHelper.ShadowColor="#66CCCC"
  51. BorderBrush="#99CCCC"
  52. FontSize="12"
  53. Foreground="#99CCCC"
  54. Header="{Binding Description}"
  55. Tag="{Binding NodeId}">
  56. <UniformGrid Columns="1" Rows="4">
  57. <StackPanel
  58. Margin="0,2"
  59. HorizontalAlignment="Center"
  60. VerticalAlignment="Center"
  61. Orientation="Horizontal">
  62. <TextBlock
  63. Margin="5,0"
  64. VerticalAlignment="Center"
  65. Text="速 度:" />
  66. <TextBox
  67. x:Name="txt_speed"
  68. Width="60"
  69. Height="25"
  70. HorizontalAlignment="Center"
  71. VerticalAlignment="Center"
  72. pu:TextBoxHelper.CornerRadius="10"
  73. pu:TextBoxHelper.FocusedBorderBrush="#99CCCC"
  74. pu:TextBoxHelper.FocusedShadowColor="#99CCCC"
  75. BorderBrush="#99CCCC"
  76. Cursor="IBeam"
  77. Foreground="#99CCCC"
  78. Text="{Binding Speed, Mode=TwoWay}" />
  79. </StackPanel>
  80. <StackPanel
  81. Margin="0,2"
  82. HorizontalAlignment="Center"
  83. VerticalAlignment="Center"
  84. Orientation="Horizontal">
  85. <TextBlock
  86. Margin="5,0"
  87. VerticalAlignment="Center"
  88. Text="加速度:" />
  89. <TextBox
  90. x:Name="txt_acspeed"
  91. Width="60"
  92. Height="25"
  93. HorizontalAlignment="Center"
  94. VerticalAlignment="Center"
  95. pu:TextBoxHelper.CornerRadius="10"
  96. pu:TextBoxHelper.FocusedBorderBrush="#99CCCC"
  97. pu:TextBoxHelper.FocusedShadowColor="#99CCCC"
  98. BorderBrush="#99CCCC"
  99. Foreground="#99CCCC"
  100. Text="{Binding AcSpeed, Mode=TwoWay}" />
  101. </StackPanel>
  102. <StackPanel
  103. Margin="0,2"
  104. HorizontalAlignment="Center"
  105. VerticalAlignment="Center"
  106. Orientation="Horizontal">
  107. <TextBlock
  108. Margin="5,0"
  109. VerticalAlignment="Center"
  110. Text="减速度:" />
  111. <TextBox
  112. x:Name="txt_despeed"
  113. Width="60"
  114. Height="25"
  115. HorizontalAlignment="Center"
  116. VerticalAlignment="Center"
  117. pu:TextBoxHelper.CornerRadius="10"
  118. pu:TextBoxHelper.FocusedBorderBrush="#99CCCC"
  119. pu:TextBoxHelper.FocusedShadowColor="#99CCCC"
  120. BorderBrush="#99CCCC"
  121. Foreground="#99CCCC"
  122. Text="{Binding DeSpeed, Mode=TwoWay}" />
  123. </StackPanel>
  124. <Button
  125. Name="btn_speedsetting"
  126. Width="50"
  127. Height="25"
  128. Margin="5,0"
  129. HorizontalAlignment="Right"
  130. VerticalAlignment="Center"
  131. pu:ButtonHelper.CornerRadius="10"
  132. pu:ButtonHelper.HoverBrush="#66CCCC"
  133. Background="#99CCCC"
  134. Command="{Binding ElementName=otherSetting, Path=DataContext.SettingSpeedCommand}"
  135. Content="更新"
  136. Cursor="Hand"
  137. Foreground="White">
  138. <Button.CommandParameter>
  139. <Binding ElementName="gb_speed" Path="Tag" />
  140. </Button.CommandParameter>
  141. </Button>
  142. </UniformGrid>
  143. </GroupBox>
  144. </Grid>
  145. </Viewbox>
  146. </DataTemplate>
  147. <!--#endregion-->
  148. </ResourceDictionary>
  149. </UserControl.Resources>
  150. <Grid>
  151. <Grid.RowDefinitions>
  152. <RowDefinition />
  153. <RowDefinition Height="1.5*"/>
  154. <RowDefinition Height="6.2*" />
  155. </Grid.RowDefinitions>
  156. <Grid
  157. Grid.Row="0"
  158. HorizontalAlignment="Center"
  159. VerticalAlignment="Center">
  160. <GroupBox
  161. Grid.Row="3"
  162. Width="700"
  163. Height="80"
  164. Margin="0,5,0,5"
  165. HorizontalAlignment="Center"
  166. VerticalAlignment="Center"
  167. pu:GroupBoxHelper.CornerRadius="8"
  168. pu:GroupBoxHelper.IsSplitLineVisible="True"
  169. pu:GroupBoxHelper.ShadowColor="#66CCCC"
  170. BorderBrush="#99CCCC"
  171. Foreground="#99CCCC"
  172. Header="模板路径">
  173. <StackPanel Orientation="Horizontal">
  174. <TextBlock
  175. Height="30"
  176. MinWidth="0"
  177. Margin="0,10,0,0"
  178. HorizontalAlignment="Center"
  179. VerticalAlignment="Center"
  180. Background="Transparent"
  181. Foreground="#99CCCC"
  182. Text="{Binding TemplateFilePath}" />
  183. <Button
  184. Width="80"
  185. Height="25"
  186. Margin="10,0"
  187. HorizontalAlignment="Center"
  188. VerticalAlignment="Center"
  189. pu:ButtonHelper.CornerRadius="8"
  190. pu:ButtonHelper.HoverBrush="#66CCCC"
  191. Background="#99CCCC"
  192. Command="{Binding OptTemplatePathCommand}"
  193. Content="选择目录"
  194. Cursor="Hand"
  195. FontFamily="{StaticResource FontAwesome}"
  196. Foreground="White" />
  197. </StackPanel>
  198. </GroupBox>
  199. </Grid>
  200. <Grid
  201. Grid.Row="1"
  202. HorizontalAlignment="Center"
  203. VerticalAlignment="Center">
  204. <GroupBox
  205. Grid.Row="3"
  206. Width="700"
  207. Height="105"
  208. HorizontalAlignment="Center"
  209. VerticalAlignment="Center"
  210. pu:GroupBoxHelper.CornerRadius="8"
  211. pu:GroupBoxHelper.IsSplitLineVisible="True"
  212. pu:GroupBoxHelper.ShadowColor="#66CCCC"
  213. BorderBrush="#99CCCC"
  214. Foreground="#99CCCC"
  215. Header="导出结果存放路径">
  216. <Grid>
  217. <Grid.RowDefinitions>
  218. <RowDefinition />
  219. <RowDefinition />
  220. </Grid.RowDefinitions>
  221. <StackPanel Orientation="Horizontal">
  222. <RadioButton
  223. pu:RadioButtonHelper.CheckedBackground="#6452A4"
  224. BorderBrush="#99CCCC"
  225. Foreground="#99CCCC"
  226. Content="Excel"
  227. GroupName="exportType"
  228. IsChecked="{Binding ExportTypeByExcel}" />
  229. <RadioButton
  230. Margin="10,0,0,0"
  231. pu:RadioButtonHelper.CheckedBackground="#6452A4"
  232. BorderBrush="#99CCCC"
  233. Foreground="#99CCCC"
  234. Content="Word"
  235. GroupName="exportType"
  236. IsChecked="{Binding ExportTypeByWord}" />
  237. </StackPanel>
  238. <StackPanel Grid.Row="1" Orientation="Horizontal">
  239. <TextBlock
  240. Height="30"
  241. MinWidth="0"
  242. Margin="0,10,0,0"
  243. HorizontalAlignment="Center"
  244. VerticalAlignment="Center"
  245. Background="Transparent"
  246. Foreground="#99CCCC"
  247. Text="{Binding SampleResultFilePath}" />
  248. <Button
  249. Width="80"
  250. Height="25"
  251. Margin="10,0"
  252. HorizontalAlignment="Center"
  253. VerticalAlignment="Center"
  254. pu:ButtonHelper.CornerRadius="8"
  255. pu:ButtonHelper.HoverBrush="#66CCCC"
  256. Background="#99CCCC"
  257. Command="{Binding OptSampleResultPathCommand}"
  258. Content="选择目录"
  259. Cursor="Hand"
  260. FontFamily="{StaticResource FontAwesome}"
  261. Foreground="White" />
  262. </StackPanel>
  263. </Grid>
  264. </GroupBox>
  265. </Grid>
  266. <Grid
  267. Grid.Row="2"
  268. HorizontalAlignment="Center"
  269. VerticalAlignment="Center">
  270. <GroupBox
  271. Grid.Row="3"
  272. Width="700"
  273. Height="460"
  274. Margin="0,5,0,5"
  275. HorizontalAlignment="Center"
  276. VerticalAlignment="Center"
  277. pu:GroupBoxHelper.CornerRadius="8"
  278. pu:GroupBoxHelper.IsSplitLineVisible="True"
  279. pu:GroupBoxHelper.ShadowColor="#66CCCC"
  280. BorderBrush="#99CCCC"
  281. Foreground="#99CCCC"
  282. Header="速度设置">
  283. <Grid>
  284. <Grid.RowDefinitions>
  285. <RowDefinition Height="1*" />
  286. <RowDefinition Height="8*" />
  287. </Grid.RowDefinitions>
  288. <StackPanel
  289. Grid.Row="0"
  290. Margin="5,0"
  291. VerticalAlignment="Center"
  292. Background="#99CCCC">
  293. <CheckBox
  294. Height="30"
  295. Margin="0,0,10,0"
  296. HorizontalAlignment="Right"
  297. pu:CheckBoxHelper.BoxHeight="16"
  298. pu:CheckBoxHelper.BoxWidth="24"
  299. pu:CheckBoxHelper.CheckBoxStyle="Switch"
  300. pu:CheckBoxHelper.CheckedBackground="#99CCCC"
  301. BorderBrush="White"
  302. Content="连接成功后自动设置速度"
  303. Cursor="Hand"
  304. FontSize="14"
  305. Foreground="White"
  306. IsChecked="{Binding AutoWriteSpeed}" />
  307. </StackPanel>
  308. <ListView
  309. Grid.Row="1"
  310. Width="680"
  311. Background="Transparent"
  312. BorderBrush="Transparent"
  313. ItemContainerStyle="{StaticResource ItemContainerStyle}"
  314. ItemTemplate="{StaticResource ResourceKey=SpeedTemplate}"
  315. ItemsSource="{Binding SpeedInfos}">
  316. <ListView.ItemsPanel>
  317. <ItemsPanelTemplate>
  318. <UniformGrid Columns="5" Rows="2" />
  319. </ItemsPanelTemplate>
  320. </ListView.ItemsPanel>
  321. </ListView>
  322. </Grid>
  323. </GroupBox>
  324. </Grid>
  325. </Grid>
  326. </UserControl>