MainWindow.xaml 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332
  1. <Window
  2. x:Class="ShakerManger.MainWindow"
  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:data="clr-namespace:ShakerManger.Data"
  7. xmlns:hc="https://handyorg.github.io/handycontrol"
  8. xmlns:local="clr-namespace:ShakerManger"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:system="clr-namespace:System;assembly=mscorlib"
  11. xmlns:view="clr-namespace:ShakerManger.View"
  12. xmlns:vm="clr-namespace:ShakerManger.ViewModel"
  13. Title="MainWindow"
  14. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  15. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  16. d:DataContext="{d:DesignInstance {x:Type vm:MainWindowViewModel}}"
  17. BorderThickness="0"
  18. DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data}"
  19. Left="0"
  20. ResizeMode="NoResize"
  21. Top="0"
  22. Topmost="True"
  23. WindowStartupLocation="Manual"
  24. WindowState="Normal"
  25. WindowStyle="None"
  26. mc:Ignorable="d">
  27. <Window.Resources>
  28. <Geometry x:Key="MainGeometry">M0,0 L1920,0 L1920,100 L1680,100 L1610,20 L600,20 L530,100 L0,100Z</Geometry>
  29. <vm:BindingProxy x:Key="DeviceControl" Data="{x:Static system:Boolean.FalseString}" />
  30. </Window.Resources>
  31. <Window.Background>
  32. <ImageBrush ImageSource="/Resources/background.png" Opacity="0.6" />
  33. </Window.Background>
  34. <hc:Interaction.Triggers>
  35. <hc:EventTrigger EventName="Closing">
  36. <hc:InvokeCommandAction Command="{Binding CloseCommand}" />
  37. </hc:EventTrigger>
  38. </hc:Interaction.Triggers>
  39. <WindowChrome.WindowChrome>
  40. <WindowChrome
  41. CaptionHeight="0"
  42. CornerRadius="0"
  43. GlassFrameThickness="0"
  44. ResizeBorderThickness="0" />
  45. </WindowChrome.WindowChrome>
  46. <Viewbox Stretch="Fill">
  47. <Grid Width="1920" Height="1080">
  48. <Grid.Style>
  49. <Style TargetType="Grid">
  50. <Setter Property="IsEnabled">
  51. <Setter.Value>
  52. <MultiBinding
  53. Converter="{StaticResource MainWindowEnabledConverter}"
  54. ConverterParameter="1"
  55. Mode="OneWay">
  56. <Binding
  57. Mode="OneWay"
  58. Path="Data.IsOpen"
  59. Source="{StaticResource Prompt}" />
  60. <Binding
  61. Converter="{StaticResource Boolean2BooleanReConverter}"
  62. Mode="OneWay"
  63. Path="Data.IsLoggedIn"
  64. Source="{StaticResource Login}" />
  65. <Binding
  66. Mode="OneWay"
  67. Path="Data"
  68. Source="{StaticResource DeviceControl}" />
  69. <Binding
  70. Mode="OneWay"
  71. Path="IsOpen"
  72. Source="{x:Static vm:ProgressViewModel.Default}" />
  73. </MultiBinding>
  74. </Setter.Value>
  75. </Setter>
  76. </Style>
  77. </Grid.Style>
  78. <Grid.RowDefinitions>
  79. <RowDefinition Height="120" />
  80. <RowDefinition Height="*" />
  81. <RowDefinition Height="20" />
  82. </Grid.RowDefinitions>
  83. <StackPanel
  84. Grid.Row="2"
  85. HorizontalAlignment="Center"
  86. VerticalAlignment="Center"
  87. Orientation="Horizontal">
  88. <Viewbox Width="28" Height="28">
  89. <Path Data="{StaticResource CEAPGepmetry}" Fill="Red" />
  90. </Viewbox>
  91. <TextBlock
  92. Margin="10,0,0,0"
  93. HorizontalAlignment="Center"
  94. VerticalAlignment="Center"
  95. FontSize="14"
  96. Foreground="White"
  97. Text="中国工程物理研究院总体工程研究所" />
  98. </StackPanel>
  99. <Grid>
  100. <Viewbox Margin="10" Stretch="Fill">
  101. <Path
  102. Data="{StaticResource MainGeometry}"
  103. Stroke="#1F6cd7ea"
  104. StrokeThickness="1">
  105. <Path.Effect>
  106. <DropShadowEffect
  107. BlurRadius="20"
  108. Opacity="1"
  109. ShadowDepth="0"
  110. Color="{StaticResource ButtonEffectColor}" />
  111. </Path.Effect>
  112. </Path>
  113. </Viewbox>
  114. <Viewbox Margin="10" Stretch="Fill">
  115. <hc:AnimationPath
  116. Data="{StaticResource MainGeometry}"
  117. Stroke="Blue"
  118. StrokeThickness="2"
  119. Duration="0:0:5" />
  120. </Viewbox>
  121. <TextBlock
  122. Margin="20,0,0,0"
  123. HorizontalAlignment="Left"
  124. VerticalAlignment="Center"
  125. FontSize="52"
  126. Foreground="{StaticResource WindowTitleColor}"
  127. Text="{StaticResource Title}" />
  128. <ListView
  129. Height="60"
  130. Margin="560,40,320,0"
  131. IsEnabled="{Binding IsEnabled}"
  132. ItemsSource="{Binding MainPages}"
  133. SelectedValue="{Binding CurrentMainPage}">
  134. <ListView.Style>
  135. <Style TargetType="ListView" BasedOn="{x:Null}">
  136. <Setter Property="Background" Value="Transparent" />
  137. <Setter Property="BorderBrush" Value="Transparent" />
  138. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  139. <Setter Property="Padding" Value="0" />
  140. <Setter Property="Template">
  141. <Setter.Value>
  142. <ControlTemplate TargetType="ListView">
  143. <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  144. </ControlTemplate>
  145. </Setter.Value>
  146. </Setter>
  147. <Setter Property="ItemTemplate">
  148. <Setter.Value>
  149. <DataTemplate>
  150. <StackPanel
  151. HorizontalAlignment="Center"
  152. VerticalAlignment="Center"
  153. Background="Transparent"
  154. IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
  155. Orientation="Horizontal">
  156. <Grid>
  157. <Viewbox Stretch="Fill" Width="200">
  158. <Path Data="M70,0 L270,0 L200,70 L00,70Z">
  159. <Path.Style>
  160. <Style TargetType="Path">
  161. <Style.Triggers>
  162. <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListViewItem}, Path=IsSelected}" Value="True">
  163. <Setter Property="Fill">
  164. <Setter.Value>
  165. <LinearGradientBrush StartPoint="0.45,0" EndPoint="0.55,1">
  166. <GradientStop Offset="0" Color="#1A5eea" />
  167. <GradientStop Offset="1" Color="#1A7eff" />
  168. </LinearGradientBrush>
  169. </Setter.Value>
  170. </Setter>
  171. </DataTrigger>
  172. <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListViewItem}, Path=IsSelected}" Value="False">
  173. <Setter Property="Fill">
  174. <Setter.Value>
  175. <RadialGradientBrush Center="0.5,0.5">
  176. <GradientStop Color="#01015EEA" />
  177. <GradientStop Offset="1" Color="#3F007EFF" />
  178. </RadialGradientBrush>
  179. </Setter.Value>
  180. </Setter>
  181. </DataTrigger>
  182. </Style.Triggers>
  183. </Style>
  184. </Path.Style>
  185. <Path.Effect>
  186. <DropShadowEffect
  187. BlurRadius="20"
  188. Opacity="1"
  189. RenderingBias="Quality"
  190. ShadowDepth="0"
  191. Color="{StaticResource ButtonEffectColor}" />
  192. </Path.Effect>
  193. </Path>
  194. </Viewbox>
  195. <TextBlock
  196. HorizontalAlignment="Center"
  197. VerticalAlignment="Center"
  198. FontSize="22"
  199. Foreground="{StaticResource SystemItemsForeColor}"
  200. Text="{Binding MainPageType, Converter={StaticResource EnumToDescription}}" />
  201. </Grid>
  202. </StackPanel>
  203. </DataTemplate>
  204. </Setter.Value>
  205. </Setter>
  206. <Setter Property="ItemContainerStyle">
  207. <Setter.Value>
  208. <Style TargetType="ListViewItem">
  209. <Setter Property="Background" Value="Transparent" />
  210. <Setter Property="BorderBrush" Value="Transparent" />
  211. <Setter Property="BorderThickness" Value="0" />
  212. <Setter Property="SnapsToDevicePixels" Value="True" />
  213. <Setter Property="OverridesDefaultStyle" Value="True" />
  214. <Setter Property="Cursor" Value="Hand" />
  215. <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
  216. <Setter Property="Padding" Value="0" />
  217. <Setter Property="Template">
  218. <Setter.Value>
  219. <ControlTemplate TargetType="ListViewItem">
  220. <ContentPresenter
  221. Margin="0,0,0,0"
  222. Content="{TemplateBinding Content}"
  223. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  224. ContentTemplate="{TemplateBinding ContentTemplate}"
  225. ContentTemplateSelector="{x:Null}"
  226. IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
  227. </ControlTemplate>
  228. </Setter.Value>
  229. </Setter>
  230. </Style>
  231. </Setter.Value>
  232. </Setter>
  233. <Setter Property="ItemsPanel">
  234. <Setter.Value>
  235. <ItemsPanelTemplate>
  236. <UniformGrid
  237. Margin="0"
  238. Rows="1"
  239. Style="{x:Null}" />
  240. </ItemsPanelTemplate>
  241. </Setter.Value>
  242. </Setter>
  243. </Style>
  244. </ListView.Style>
  245. </ListView>
  246. <TextBlock
  247. Margin="0,20,20,0"
  248. HorizontalAlignment="Right"
  249. VerticalAlignment="Top"
  250. FontSize="24"
  251. Foreground="Aqua"
  252. Text="{Binding NowTime, StringFormat=yyyy-MM-dd HH:mm:ss}" />
  253. <StackPanel
  254. Margin="0,0,20,20"
  255. HorizontalAlignment="Right"
  256. VerticalAlignment="Bottom"
  257. Background="Transparent"
  258. Orientation="Horizontal">
  259. <Button
  260. Width="42"
  261. Height="42"
  262. VerticalAlignment="Center"
  263. hc:IconElement.Geometry="{StaticResource DeviceControlGeometry}"
  264. Cursor="Hand"
  265. IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
  266. Style="{StaticResource ImageButton}"
  267. ToolTip="设备控制">
  268. <hc:Interaction.Triggers>
  269. <hc:EventTrigger EventName="Click">
  270. <hc:SetPropertyAction
  271. PropertyName="Data"
  272. PropertyValue="{x:Static system:Boolean.TrueString}"
  273. TargetObject="{Binding Source={StaticResource DeviceControl}}" />
  274. </hc:EventTrigger>
  275. </hc:Interaction.Triggers>
  276. </Button>
  277. <Grid Margin="20,0,0,0">
  278. <Button
  279. Width="42"
  280. Height="42"
  281. hc:IconElement.Geometry="m63.94311,0l668.44444,0c32.99556,0 60.13156,24.91733 63.71556,56.94578l0.34133,6.99733l0,668.55822c0,32.99556 -24.91733,60.07467 -56.94578,63.54489l-6.99733,0.39822l-668.55822,0c-32.99556,0 -60.07467,-24.91733 -63.54489,-56.94578l-0.39822,-6.99733l0,-668.55822c0,-32.99556 24.91733,-60.07467 56.94578,-63.54489l6.99733,-0.39822l668.44444,0l-668.44444,0zm107.06489,56.88889l-114.11911,0l0,682.66666l682.66666,0l0,-682.66666l-114.11911,0l0.22756,3.47022l0.11378,3.584l0,213.44711c0,32.99556 -21.33334,60.07467 -48.81067,63.54489l-5.97333,0.39822l-345.54312,0c-28.27377,0 -51.48444,-24.91733 -54.44266,-56.94578l-0.34134,-6.99733l0,-213.44711c0,-2.38933 0.11378,-4.72178 0.34134,-7.05422zm397.88089,0l-341.33334,0l0,227.55555l341.33334,0l0,-227.55555zm-85.33334,56.88889a28.44444,28.44444 0 0 1 28.44445,28.44444l0,56.88889a28.44444,28.44444 0 1 1 -56.88889,0l0,-56.88889a28.44444,28.44444 0 0 1 28.44444,-28.44444z"
  282. Background="Transparent"
  283. Command="{Binding SaveDataCommand}"
  284. Cursor="Hand">
  285. <Button.Style>
  286. <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
  287. <Style.Triggers>
  288. <MultiDataTrigger>
  289. <MultiDataTrigger.Conditions>
  290. <Condition Binding="{Binding IsEnabled}" Value="True" />
  291. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
  292. </MultiDataTrigger.Conditions>
  293. <Setter Property="IsEnabled" Value="True" />
  294. </MultiDataTrigger>
  295. <MultiDataTrigger>
  296. <MultiDataTrigger.Conditions>
  297. <Condition Binding="{Binding IsEnabled}" Value="False" />
  298. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
  299. </MultiDataTrigger.Conditions>
  300. <Setter Property="IsEnabled" Value="False" />
  301. </MultiDataTrigger>
  302. <MultiDataTrigger>
  303. <MultiDataTrigger.Conditions>
  304. <Condition Binding="{Binding IsEnabled}" Value="False" />
  305. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
  306. </MultiDataTrigger.Conditions>
  307. <Setter Property="IsEnabled" Value="False" />
  308. </MultiDataTrigger>
  309. <MultiDataTrigger>
  310. <MultiDataTrigger.Conditions>
  311. <Condition Binding="{Binding IsEnabled}" Value="True" />
  312. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
  313. </MultiDataTrigger.Conditions>
  314. <Setter Property="IsEnabled" Value="False" />
  315. </MultiDataTrigger>
  316. </Style.Triggers>
  317. </Style>
  318. </Button.Style>
  319. </Button>
  320. <Viewbox
  321. Width="20"
  322. Height="20"
  323. Margin="0,10,0,0"
  324. IsHitTestVisible="False"
  325. Visibility="{Binding IsSaveData, Converter={StaticResource Boolean2VisibilityConverter}}">
  326. <Path
  327. Data="m0,508.958c0,-37.982 30.385,-68.367 68.367,-68.367c45.578,0 75.964,30.385 75.964,68.367c0,45.578 -30.385,75.964 -75.964,75.964c-37.982,0 -68.367,-30.385 -68.367,-75.964zm91.157,-265.873l0,0c0,-53.175 37.982,-98.753 91.157,-98.753s98.753,45.578 98.753,98.753l0,0c0,53.175 -45.578,91.157 -98.753,91.157s-91.157,-37.982 -91.157,-91.157l0,0zm37.982,539.344l0,0c0,-30.385 22.789,-53.175 53.175,-53.175s53.175,22.789 53.175,53.175l0,0c0,30.385 -22.789,53.175 -53.175,53.175s-53.175,-22.789 -53.175,-53.175zm265.874,113.946l0,0c0,-37.982 22.789,-60.772 60.772,-60.772s60.772,22.789 60.772,60.772l0,0c0,37.982 -22.789,60.772 -60.772,60.772c-37.982,0 -60.772,-22.789 -60.772,-60.772zm296.26,-113.946c0,-22.789 15.193,-37.982 37.982,-37.982s37.982,15.193 37.982,37.982c0,22.789 -15.193,37.982 -37.982,37.982c-22.789,0 -37.982,-15.193 -37.982,-37.982zm83.56,-273.471c0,-30.385 30.385,-60.772 68.367,-60.772c30.385,0 60.772,30.385 60.772,60.772c0,37.982 -30.385,68.367 -60.772,68.367c-37.982,0 -68.367,-30.385 -68.367,-68.367zm-174.717,-265.873c0,-75.964 60.772,-129.139 129.139,-129.139s129.139,53.175 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139zm-273.47,-113.946c0,-68.367 60.772,-129.139 129.139,-129.139s129.139,60.772 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139z"
  328. Fill="Green"
  329. RenderTransformOrigin="0.5,0.5">
  330. <Path.RenderTransform>
  331. <TransformGroup>
  332. <ScaleTransform />
  333. <SkewTransform />
  334. <RotateTransform Angle="0" />
  335. <TranslateTransform />
  336. </TransformGroup>
  337. </Path.RenderTransform>
  338. <Path.Triggers>
  339. <EventTrigger RoutedEvent="Loaded">
  340. <BeginStoryboard>
  341. <Storyboard>
  342. <DoubleAnimation
  343. AutoReverse="False"
  344. RepeatBehavior="Forever"
  345. SpeedRatio="1"
  346. Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
  347. From="0"
  348. To="360"
  349. Duration="0:0:1" />
  350. </Storyboard>
  351. </BeginStoryboard>
  352. </EventTrigger>
  353. </Path.Triggers>
  354. </Path>
  355. </Viewbox>
  356. </Grid>
  357. <Button
  358. Width="42"
  359. Height="42"
  360. Margin="20,0,0,0"
  361. VerticalAlignment="Center"
  362. hc:IconElement.Geometry="{StaticResource LayoutGeometry}"
  363. Cursor="Hand"
  364. IsEnabled="{Binding LayoutVisibily}">
  365. <Button.Style>
  366. <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
  367. <Style.Triggers>
  368. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ShakerManger}">
  369. <Setter Property="Visibility" Value="Visible" />
  370. </DataTrigger>
  371. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ConfigManger}">
  372. <Setter Property="Visibility" Value="Collapsed" />
  373. </DataTrigger>
  374. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.DataManger}">
  375. <Setter Property="Visibility" Value="Collapsed" />
  376. </DataTrigger>
  377. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.LogManger}">
  378. <Setter Property="Visibility" Value="Collapsed" />
  379. </DataTrigger>
  380. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.WarnManger}">
  381. <Setter Property="Visibility" Value="Collapsed" />
  382. </DataTrigger>
  383. </Style.Triggers>
  384. </Style>
  385. </Button.Style>
  386. <hc:Interaction.Triggers>
  387. <hc:EventTrigger EventName="Click">
  388. <hc:SetPropertyAction
  389. PropertyName="IsOpen"
  390. PropertyValue="{x:Static system:Boolean.TrueString}"
  391. TargetObject="{Binding LayoutManger}" />
  392. </hc:EventTrigger>
  393. </hc:Interaction.Triggers>
  394. </Button>
  395. <Button
  396. Width="42"
  397. Height="42"
  398. Margin="20,0,0,0"
  399. VerticalAlignment="Center"
  400. hc:IconElement.Geometry="{StaticResource CloseGeometry}"
  401. Command="{Binding ExitCommand}"
  402. Cursor="Hand"
  403. Style="{StaticResource ImageButton}"
  404. ToolTip="关闭" />
  405. </StackPanel>
  406. </Grid>
  407. <Border
  408. Grid.ColumnSpan="2"
  409. Background="{StaticResource TitleBackColor}"
  410. Visibility="Collapsed">
  411. <Grid>
  412. <Grid.ColumnDefinitions>
  413. <ColumnDefinition Width="400" />
  414. <ColumnDefinition Width="*" />
  415. <ColumnDefinition Width="200" />
  416. <ColumnDefinition Width="auto" />
  417. </Grid.ColumnDefinitions>
  418. <TextBlock
  419. Margin="20,0,10,0"
  420. VerticalAlignment="Center"
  421. FontSize="36"
  422. FontWeight="Bold"
  423. Text="{StaticResource Title}" />
  424. <ListView
  425. Grid.Column="1"
  426. Margin="20,0,20,0"
  427. IsEnabled="{Binding IsEnabled}"
  428. ItemsSource="{Binding MainPages}"
  429. SelectedValue="{Binding CurrentMainPage}">
  430. <ListView.Style>
  431. <Style TargetType="ListView" BasedOn="{x:Null}">
  432. <Setter Property="Background" Value="Transparent" />
  433. <Setter Property="BorderBrush" Value="Transparent" />
  434. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  435. <Setter Property="Padding" Value="0" />
  436. <Setter Property="Template">
  437. <Setter.Value>
  438. <ControlTemplate TargetType="ListView">
  439. <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  440. </ControlTemplate>
  441. </Setter.Value>
  442. </Setter>
  443. <Setter Property="ItemTemplate">
  444. <Setter.Value>
  445. <DataTemplate>
  446. <StackPanel
  447. Margin="0"
  448. HorizontalAlignment="Center"
  449. VerticalAlignment="Center"
  450. Background="Transparent"
  451. IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
  452. Orientation="Horizontal">
  453. <Viewbox
  454. Width="32"
  455. Height="32"
  456. HorizontalAlignment="Right"
  457. VerticalAlignment="Center">
  458. <Path Data="{Binding IconPath}" Fill="{StaticResource SystemItemsForeColor}" />
  459. </Viewbox>
  460. <TextBlock
  461. Grid.Column="1"
  462. Margin="20,0,0,0"
  463. HorizontalAlignment="Left"
  464. VerticalAlignment="Center"
  465. FontSize="22"
  466. Foreground="{StaticResource SystemItemsForeColor}"
  467. Text="{Binding MainPageType, Converter={StaticResource EnumToDescription}}" />
  468. </StackPanel>
  469. </DataTemplate>
  470. </Setter.Value>
  471. </Setter>
  472. <Setter Property="ItemContainerStyle">
  473. <Setter.Value>
  474. <Style TargetType="ListViewItem">
  475. <Setter Property="Background" Value="Transparent" />
  476. <Setter Property="BorderBrush" Value="Transparent" />
  477. <Setter Property="BorderThickness" Value="0" />
  478. <Setter Property="SnapsToDevicePixels" Value="True" />
  479. <Setter Property="OverridesDefaultStyle" Value="True" />
  480. <Setter Property="Cursor" Value="Hand" />
  481. <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
  482. <Setter Property="Padding" Value="0" />
  483. <Setter Property="Template">
  484. <Setter.Value>
  485. <ControlTemplate TargetType="ListViewItem">
  486. <Border
  487. x:Name="backcolor"
  488. Margin="0"
  489. Padding="0"
  490. CornerRadius="12,12,0,0">
  491. <ContentPresenter
  492. Margin="0"
  493. Content="{TemplateBinding Content}"
  494. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  495. ContentTemplate="{TemplateBinding ContentTemplate}"
  496. ContentTemplateSelector="{x:Null}"
  497. IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
  498. </Border>
  499. <ControlTemplate.Triggers>
  500. <Trigger Property="IsSelected" Value="True">
  501. <Setter TargetName="backcolor" Property="Background" Value="{StaticResource SystemItemsSelectBackColor}" />
  502. </Trigger>
  503. </ControlTemplate.Triggers>
  504. </ControlTemplate>
  505. </Setter.Value>
  506. </Setter>
  507. </Style>
  508. </Setter.Value>
  509. </Setter>
  510. <Setter Property="ItemsPanel">
  511. <Setter.Value>
  512. <ItemsPanelTemplate>
  513. <UniformGrid
  514. Margin="0"
  515. Rows="1"
  516. Style="{x:Null}" />
  517. </ItemsPanelTemplate>
  518. </Setter.Value>
  519. </Setter>
  520. </Style>
  521. </ListView.Style>
  522. </ListView>
  523. <UniformGrid Grid.Column="2" Rows="1">
  524. <Button
  525. Width="42"
  526. Height="42"
  527. Padding="0"
  528. hc:IconElement.Geometry="{StaticResource StartGeometry}"
  529. Command="{Binding StartAllCommand}"
  530. IsEnabled="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
  531. Style="{StaticResource ImageButton}"
  532. ToolTip="全部开始" />
  533. <Button
  534. Width="42"
  535. Height="42"
  536. Padding="0"
  537. hc:IconElement.Geometry="{StaticResource StopGeometry}"
  538. Command="{Binding StopAllCommand}"
  539. IsEnabled="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
  540. Style="{StaticResource ImageButton}"
  541. ToolTip="全部停止" />
  542. </UniformGrid>
  543. <StackPanel
  544. Grid.Column="3"
  545. Margin="40,0,10,0"
  546. VerticalAlignment="Center"
  547. Orientation="Horizontal">
  548. <Grid>
  549. <Button
  550. Width="42"
  551. Height="42"
  552. hc:IconElement.Geometry="m63.94311,0l668.44444,0c32.99556,0 60.13156,24.91733 63.71556,56.94578l0.34133,6.99733l0,668.55822c0,32.99556 -24.91733,60.07467 -56.94578,63.54489l-6.99733,0.39822l-668.55822,0c-32.99556,0 -60.07467,-24.91733 -63.54489,-56.94578l-0.39822,-6.99733l0,-668.55822c0,-32.99556 24.91733,-60.07467 56.94578,-63.54489l6.99733,-0.39822l668.44444,0l-668.44444,0zm107.06489,56.88889l-114.11911,0l0,682.66666l682.66666,0l0,-682.66666l-114.11911,0l0.22756,3.47022l0.11378,3.584l0,213.44711c0,32.99556 -21.33334,60.07467 -48.81067,63.54489l-5.97333,0.39822l-345.54312,0c-28.27377,0 -51.48444,-24.91733 -54.44266,-56.94578l-0.34134,-6.99733l0,-213.44711c0,-2.38933 0.11378,-4.72178 0.34134,-7.05422zm397.88089,0l-341.33334,0l0,227.55555l341.33334,0l0,-227.55555zm-85.33334,56.88889a28.44444,28.44444 0 0 1 28.44445,28.44444l0,56.88889a28.44444,28.44444 0 1 1 -56.88889,0l0,-56.88889a28.44444,28.44444 0 0 1 28.44444,-28.44444z"
  553. Command="{Binding SaveDataCommand}"
  554. Cursor="Hand">
  555. <Button.Style>
  556. <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
  557. <Style.Triggers>
  558. <MultiDataTrigger>
  559. <MultiDataTrigger.Conditions>
  560. <Condition Binding="{Binding IsEnabled}" Value="True" />
  561. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
  562. </MultiDataTrigger.Conditions>
  563. <Setter Property="IsEnabled" Value="True" />
  564. </MultiDataTrigger>
  565. <MultiDataTrigger>
  566. <MultiDataTrigger.Conditions>
  567. <Condition Binding="{Binding IsEnabled}" Value="False" />
  568. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
  569. </MultiDataTrigger.Conditions>
  570. <Setter Property="IsEnabled" Value="False" />
  571. </MultiDataTrigger>
  572. <MultiDataTrigger>
  573. <MultiDataTrigger.Conditions>
  574. <Condition Binding="{Binding IsEnabled}" Value="False" />
  575. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
  576. </MultiDataTrigger.Conditions>
  577. <Setter Property="IsEnabled" Value="False" />
  578. </MultiDataTrigger>
  579. <MultiDataTrigger>
  580. <MultiDataTrigger.Conditions>
  581. <Condition Binding="{Binding IsEnabled}" Value="True" />
  582. <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
  583. </MultiDataTrigger.Conditions>
  584. <Setter Property="IsEnabled" Value="False" />
  585. </MultiDataTrigger>
  586. </Style.Triggers>
  587. </Style>
  588. </Button.Style>
  589. </Button>
  590. <Viewbox
  591. Width="20"
  592. Height="20"
  593. Margin="0,10,0,0"
  594. IsHitTestVisible="False"
  595. Visibility="{Binding IsSaveData, Converter={StaticResource Boolean2VisibilityConverter}}">
  596. <Path
  597. Data="m0,508.958c0,-37.982 30.385,-68.367 68.367,-68.367c45.578,0 75.964,30.385 75.964,68.367c0,45.578 -30.385,75.964 -75.964,75.964c-37.982,0 -68.367,-30.385 -68.367,-75.964zm91.157,-265.873l0,0c0,-53.175 37.982,-98.753 91.157,-98.753s98.753,45.578 98.753,98.753l0,0c0,53.175 -45.578,91.157 -98.753,91.157s-91.157,-37.982 -91.157,-91.157l0,0zm37.982,539.344l0,0c0,-30.385 22.789,-53.175 53.175,-53.175s53.175,22.789 53.175,53.175l0,0c0,30.385 -22.789,53.175 -53.175,53.175s-53.175,-22.789 -53.175,-53.175zm265.874,113.946l0,0c0,-37.982 22.789,-60.772 60.772,-60.772s60.772,22.789 60.772,60.772l0,0c0,37.982 -22.789,60.772 -60.772,60.772c-37.982,0 -60.772,-22.789 -60.772,-60.772zm296.26,-113.946c0,-22.789 15.193,-37.982 37.982,-37.982s37.982,15.193 37.982,37.982c0,22.789 -15.193,37.982 -37.982,37.982c-22.789,0 -37.982,-15.193 -37.982,-37.982zm83.56,-273.471c0,-30.385 30.385,-60.772 68.367,-60.772c30.385,0 60.772,30.385 60.772,60.772c0,37.982 -30.385,68.367 -60.772,68.367c-37.982,0 -68.367,-30.385 -68.367,-68.367zm-174.717,-265.873c0,-75.964 60.772,-129.139 129.139,-129.139s129.139,53.175 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139zm-273.47,-113.946c0,-68.367 60.772,-129.139 129.139,-129.139s129.139,60.772 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139z"
  598. Fill="Green"
  599. RenderTransformOrigin="0.5,0.5">
  600. <Path.RenderTransform>
  601. <TransformGroup>
  602. <ScaleTransform />
  603. <SkewTransform />
  604. <RotateTransform Angle="0" />
  605. <TranslateTransform />
  606. </TransformGroup>
  607. </Path.RenderTransform>
  608. <Path.Triggers>
  609. <EventTrigger RoutedEvent="Loaded">
  610. <BeginStoryboard>
  611. <Storyboard>
  612. <DoubleAnimation
  613. AutoReverse="False"
  614. RepeatBehavior="Forever"
  615. SpeedRatio="1"
  616. Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
  617. From="0"
  618. To="360"
  619. Duration="0:0:1" />
  620. </Storyboard>
  621. </BeginStoryboard>
  622. </EventTrigger>
  623. </Path.Triggers>
  624. </Path>
  625. </Viewbox>
  626. </Grid>
  627. <Button
  628. Width="42"
  629. Height="42"
  630. Margin="20,0,0,0"
  631. VerticalAlignment="Center"
  632. hc:IconElement.Geometry="{StaticResource LayoutGeometry}"
  633. Background="{StaticResource TitleBackColor}"
  634. Cursor="Hand"
  635. IsEnabled="{Binding LayoutVisibily}">
  636. <Button.Style>
  637. <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
  638. <Style.Triggers>
  639. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ShakerManger}">
  640. <Setter Property="Visibility" Value="Visible" />
  641. </DataTrigger>
  642. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ConfigManger}">
  643. <Setter Property="Visibility" Value="Collapsed" />
  644. </DataTrigger>
  645. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.DataManger}">
  646. <Setter Property="Visibility" Value="Collapsed" />
  647. </DataTrigger>
  648. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.LogManger}">
  649. <Setter Property="Visibility" Value="Collapsed" />
  650. </DataTrigger>
  651. <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.WarnManger}">
  652. <Setter Property="Visibility" Value="Collapsed" />
  653. </DataTrigger>
  654. </Style.Triggers>
  655. </Style>
  656. </Button.Style>
  657. <hc:Interaction.Triggers>
  658. <hc:EventTrigger EventName="Click">
  659. <hc:SetPropertyAction
  660. PropertyName="IsOpen"
  661. PropertyValue="{x:Static system:Boolean.TrueString}"
  662. TargetObject="{Binding LayoutManger}" />
  663. </hc:EventTrigger>
  664. </hc:Interaction.Triggers>
  665. </Button>
  666. <Button
  667. Width="42"
  668. Height="42"
  669. Margin="20,0,0,0"
  670. VerticalAlignment="Center"
  671. hc:IconElement.Geometry="{StaticResource CloseGeometry}"
  672. Background="{StaticResource TitleBackColor}"
  673. Command="{Binding ExitCommand}"
  674. Cursor="Hand"
  675. Style="{StaticResource ImageButton}"
  676. ToolTip="关闭" />
  677. </StackPanel>
  678. </Grid>
  679. </Border>
  680. <ContentControl
  681. Grid.Row="1"
  682. Grid.ColumnSpan="2"
  683. Margin="4,0,4,0"
  684. Content="{Binding CurrentMainPage.View, Converter={StaticResource Type2ViewConverter}}"
  685. IsEnabled="{Binding IsEnabled}" />
  686. <Popup
  687. AllowsTransparency="True"
  688. IsOpen="{Binding LayoutManger.IsOpen}"
  689. Placement="Mouse"
  690. PopupAnimation="Slide"
  691. StaysOpen="False">
  692. <ContentControl Content="{Binding LayoutManger.View, Converter={StaticResource Type2ViewConverter}}" />
  693. </Popup>
  694. <Popup
  695. Grid.Row="0"
  696. Grid.RowSpan="2"
  697. Grid.ColumnSpan="2"
  698. AllowsTransparency="True"
  699. IsOpen="{Binding Source={StaticResource MainViewModel}, Path=Data.Shakers.SelectedIsOpen}"
  700. Placement="Mouse"
  701. PopupAnimation="Slide"
  702. StaysOpen="False">
  703. <view:ShakerSelectView DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data.Shakers}" />
  704. </Popup>
  705. <Popup
  706. Grid.Row="0"
  707. Grid.RowSpan="2"
  708. Grid.ColumnSpan="2"
  709. AllowsTransparency="True"
  710. IsOpen="{Binding Source={StaticResource ColorPicker}, Path=IsOpen}"
  711. Placement="Mouse"
  712. PopupAnimation="Slide"
  713. StaysOpen="True">
  714. <view:ColorPickerView DataContext="{Binding Source={StaticResource ColorPicker}}" />
  715. </Popup>
  716. <hc:Drawer
  717. Grid.Row="0"
  718. Grid.RowSpan="2"
  719. Grid.ColumnSpan="2"
  720. Dock="Top"
  721. IsOpen="{Binding Source={StaticResource MainViewModel}, Path=Data.SystemConfig.UserPage.ResetPassWord.IsOpen}">
  722. <view:ResetPassWordView />
  723. </hc:Drawer>
  724. <hc:Drawer
  725. Grid.Row="0"
  726. Grid.RowSpan="2"
  727. Grid.ColumnSpan="2"
  728. Dock="Top"
  729. IsOpen="{Binding Source={StaticResource MainViewModel}, Path=Data.SystemConfig.UserPage.AddUserViewModel.IsOpen}">
  730. <view:AddUserView />
  731. </hc:Drawer>
  732. <hc:Drawer
  733. Grid.Row="0"
  734. Grid.RowSpan="2"
  735. Grid.ColumnSpan="2"
  736. Dock="Top"
  737. IsOpen="{Binding Source={x:Static vm:ProgressViewModel.Default}, Path=IsOpen}">
  738. <Border
  739. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  740. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  741. Background="#9FAAAAAA">
  742. <view:ProgressView />
  743. </Border>
  744. </hc:Drawer>
  745. <hc:Drawer
  746. Grid.Row="0"
  747. Grid.RowSpan="2"
  748. Grid.ColumnSpan="2"
  749. DataContext="{Binding Source={StaticResource Prompt}, Path=Data}"
  750. Dock="Top"
  751. IsOpen="{Binding IsOpen}">
  752. <Border
  753. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  754. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  755. Background="#9FAAAAAA">
  756. <Border
  757. Width="560"
  758. Height="340"
  759. Background="Gray"
  760. CornerRadius="6">
  761. <Grid>
  762. <Grid.RowDefinitions>
  763. <RowDefinition Height="66" />
  764. <RowDefinition Height="2*" />
  765. <RowDefinition Height="*" />
  766. </Grid.RowDefinitions>
  767. <Border
  768. Grid.ColumnSpan="2"
  769. Background="{StaticResource ButtonNomalColor}"
  770. CornerRadius="6,6,0,0">
  771. <TextBlock
  772. HorizontalAlignment="Center"
  773. VerticalAlignment="Center"
  774. FontSize="32"
  775. FontWeight="Bold"
  776. Foreground="White"
  777. Text="{Binding Title}" />
  778. </Border>
  779. <StackPanel
  780. Grid.Row="1"
  781. HorizontalAlignment="Center"
  782. VerticalAlignment="Center"
  783. Orientation="Horizontal">
  784. <Viewbox
  785. Grid.Row="1"
  786. Grid.Column="0"
  787. Width="60"
  788. Height="60"
  789. HorizontalAlignment="Center"
  790. VerticalAlignment="Center"
  791. Visibility="{Binding IconVisibility}">
  792. <Path Data="{Binding IconGeometry, Mode=OneWay}" Fill="{Binding IconBrush}" />
  793. </Viewbox>
  794. <TextBlock
  795. Grid.Row="1"
  796. Grid.Column="1"
  797. MaxWidth="420"
  798. Margin="20"
  799. HorizontalAlignment="Left"
  800. VerticalAlignment="Center"
  801. FontSize="20"
  802. Foreground="White"
  803. Text="{Binding Message}"
  804. TextWrapping="Wrap" />
  805. </StackPanel>
  806. <StackPanel
  807. Grid.Row="2"
  808. Grid.ColumnSpan="2"
  809. HorizontalAlignment="Center"
  810. VerticalAlignment="Center"
  811. Orientation="Horizontal">
  812. <Button
  813. Width="88"
  814. Height="38"
  815. Command="{Binding YesCommand}"
  816. Content="{Binding YesText}"
  817. Cursor="Hand"
  818. FontSize="16"
  819. ToolTip="{Binding YesText}"
  820. Visibility="{Binding YesVisibility}" />
  821. <Button
  822. Width="88"
  823. Height="38"
  824. Margin="40,0,0,0"
  825. Command="{Binding NoCommand}"
  826. Content="{Binding NoText}"
  827. Cursor="Hand"
  828. FontSize="16"
  829. ToolTip="{Binding NoText}"
  830. Visibility="{Binding NoVisibility}" />
  831. </StackPanel>
  832. </Grid>
  833. </Border>
  834. </Border>
  835. </hc:Drawer>
  836. <hc:Drawer
  837. Grid.Row="0"
  838. Grid.RowSpan="2"
  839. Grid.ColumnSpan="2"
  840. Dock="Top"
  841. IsOpen="{Binding Source={StaticResource Login}, Path=Data.IsLoggedIn, Converter={StaticResource Boolean2BooleanReConverter}}">
  842. <Grid
  843. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  844. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  845. Background="#9FAAAAAA"
  846. DataContext="{Binding Source={StaticResource Login}, Path=Data}">
  847. <Grid Width="620" Height="440">
  848. <Border
  849. Background="White"
  850. BorderBrush="{StaticResource BorderBrush}"
  851. BorderThickness="1"
  852. CornerRadius="6">
  853. <Border.Effect>
  854. <BlurEffect
  855. KernelType="Box"
  856. Radius="1"
  857. RenderingBias="Quality" />
  858. </Border.Effect>
  859. </Border>
  860. <Grid
  861. Width="400"
  862. Height="420"
  863. Margin="10"
  864. HorizontalAlignment="Center"
  865. VerticalAlignment="Center">
  866. <Grid.RowDefinitions>
  867. <RowDefinition Height="100" />
  868. <RowDefinition />
  869. <RowDefinition />
  870. <RowDefinition Height="32" />
  871. <RowDefinition />
  872. </Grid.RowDefinitions>
  873. <TextBlock
  874. HorizontalAlignment="Center"
  875. VerticalAlignment="Center"
  876. FontSize="42"
  877. Foreground="{StaticResource TitleBrush}"
  878. Text="用户登录" />
  879. <StackPanel
  880. Grid.Row="1"
  881. Height="42"
  882. Orientation="Horizontal">
  883. <TextBlock
  884. HorizontalAlignment="Right"
  885. VerticalAlignment="Center"
  886. FontSize="16"
  887. Text="用户名:" />
  888. <hc:WatermarkTextBox
  889. Width="320"
  890. Height="32"
  891. Margin="10,0,0,0"
  892. VerticalAlignment="Center"
  893. VerticalContentAlignment="Center"
  894. hc:BorderElement.CornerRadius="4"
  895. BorderBrush="{StaticResource BorderBrush}"
  896. BorderThickness="1"
  897. CaretBrush="Black"
  898. FontSize="16"
  899. Foreground="Black"
  900. InputScope="AlphanumericHalfWidth"
  901. MaxLength="20"
  902. Text="{Binding UserName}"
  903. Watermark="输入用户名" />
  904. </StackPanel>
  905. <StackPanel
  906. Grid.Row="2"
  907. Height="42"
  908. Orientation="Horizontal">
  909. <TextBlock
  910. HorizontalAlignment="Right"
  911. VerticalAlignment="Center"
  912. FontSize="16"
  913. Text=" 密码:" />
  914. <hc:PasswordBox
  915. Width="320"
  916. Height="32"
  917. Margin="10,0,0,0"
  918. VerticalAlignment="Center"
  919. VerticalContentAlignment="Center"
  920. hc:InfoElement.Placeholder="输入密码"
  921. Background="Transparent"
  922. BorderBrush="{StaticResource BorderBrush}"
  923. BorderThickness="1"
  924. CaretBrush="Black"
  925. FontSize="16"
  926. Foreground="Black"
  927. IsSafeEnabled="False"
  928. MaxLength="20"
  929. ShowEyeButton="True"
  930. UnsafePassword="{Binding PassWord}">
  931. <hc:PasswordBox.InputBindings>
  932. <KeyBinding Key="Enter" Command="{Binding LoginCommand}" />
  933. </hc:PasswordBox.InputBindings>
  934. </hc:PasswordBox>
  935. </StackPanel>
  936. <TextBlock
  937. Grid.Row="3"
  938. Foreground="Red"
  939. Text="{Binding Message}" />
  940. <StackPanel
  941. Grid.Row="4"
  942. HorizontalAlignment="Center"
  943. VerticalAlignment="Center"
  944. Orientation="Horizontal">
  945. <Button
  946. Width="120"
  947. Height="36"
  948. Command="{Binding LoginCommand}"
  949. Content="登录"
  950. Cursor="Hand"
  951. FontSize="16"
  952. Foreground="Black" />
  953. <Button
  954. Width="120"
  955. Height="36"
  956. Margin="40,0,0,0"
  957. Command="{Binding Source={StaticResource MainViewModel}, Path=Data.ShutDownCommand}"
  958. Content="退出"
  959. Cursor="Hand"
  960. FontSize="16"
  961. Foreground="Black" />
  962. </StackPanel>
  963. </Grid>
  964. </Grid>
  965. <Button
  966. Margin="0,0,10,10"
  967. HorizontalAlignment="Right"
  968. VerticalAlignment="Bottom"
  969. BorderThickness="0"
  970. Command="{Binding Source={StaticResource Login}, Path=Data.AnonymousLoginCommand}"
  971. Content="匿名登录"
  972. FontSize="22"
  973. Foreground="Blue"
  974. ToolTip="匿名登录">
  975. <Button.Style>
  976. <Style TargetType="{x:Type Button}">
  977. <Setter Property="Cursor" Value="Hand" />
  978. <Setter Property="Template">
  979. <Setter.Value>
  980. <ControlTemplate TargetType="{x:Type Button}">
  981. <TextBlock
  982. x:Name="text"
  983. Text="{TemplateBinding Content}"
  984. TextDecorations="Underline" />
  985. <ControlTemplate.Triggers>
  986. <Trigger Property="IsMouseOver" Value="True">
  987. <Setter TargetName="text" Property="Foreground" Value="Red" />
  988. </Trigger>
  989. </ControlTemplate.Triggers>
  990. </ControlTemplate>
  991. </Setter.Value>
  992. </Setter>
  993. </Style>
  994. </Button.Style>
  995. </Button>
  996. </Grid>
  997. </hc:Drawer>
  998. <hc:Drawer
  999. Grid.Row="0"
  1000. Grid.RowSpan="2"
  1001. Grid.ColumnSpan="2"
  1002. Dock="Top"
  1003. IsOpen="{Binding Source={StaticResource DeviceControl}, Path=Data}">
  1004. <Grid
  1005. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  1006. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  1007. Background="#9FAAAAAA">
  1008. <Border
  1009. Width="1220"
  1010. Height="760"
  1011. Background="{StaticResource SystemItemsSelectBackColor}"
  1012. CornerRadius="6,6,0,0">
  1013. <Grid>
  1014. <Grid.Resources>
  1015. <SolidColorBrush x:Key="forecolor" Color="White" />
  1016. </Grid.Resources>
  1017. <Grid.RowDefinitions>
  1018. <RowDefinition Height="48" />
  1019. <RowDefinition Height="auto" />
  1020. <RowDefinition Height="*" />
  1021. </Grid.RowDefinitions>
  1022. <Grid Grid.Row="1">
  1023. <Grid.ColumnDefinitions>
  1024. <ColumnDefinition />
  1025. <ColumnDefinition />
  1026. </Grid.ColumnDefinitions>
  1027. <GroupBox
  1028. Grid.Row="0"
  1029. Margin="4"
  1030. hc:TitleElement.Background="Transparent"
  1031. hc:TitleElement.MinHeight="36"
  1032. Background="Transparent"
  1033. FontSize="20"
  1034. Foreground="White"
  1035. Header="功放控制"
  1036. Style="{StaticResource GroupBoxTab}">
  1037. <Grid>
  1038. <Grid.RowDefinitions>
  1039. <RowDefinition Height="160" />
  1040. <RowDefinition Height="100" />
  1041. </Grid.RowDefinitions>
  1042. <UniformGrid
  1043. Grid.Column="0"
  1044. Margin="0,10,0,0"
  1045. HorizontalAlignment="Center"
  1046. VerticalAlignment="Top"
  1047. Rows="2">
  1048. <StackPanel Orientation="Horizontal">
  1049. <TextBlock
  1050. VerticalAlignment="Center"
  1051. FontSize="24"
  1052. Foreground="{StaticResource forecolor}"
  1053. Text="增益" />
  1054. <Slider
  1055. Width="440"
  1056. Height="48"
  1057. Margin="10,0,0,0"
  1058. hc:BorderElement.CornerRadius="6,0,0,6"
  1059. Background="Green"
  1060. FontSize="24"
  1061. Foreground="{StaticResource forecolor}"
  1062. IsMoveToPointEnabled="True"
  1063. IsSnapToTickEnabled="True"
  1064. Maximum="100"
  1065. Minimum="0"
  1066. Style="{DynamicResource InputElementBaseStyle}"
  1067. Template="{DynamicResource SliderStyle}"
  1068. Value="{Binding Shakers.Gain}" />
  1069. </StackPanel>
  1070. <StackPanel
  1071. Margin="0,20,0,0"
  1072. HorizontalAlignment="Center"
  1073. Orientation="Horizontal">
  1074. <Button
  1075. Width="180"
  1076. Height="48"
  1077. Command="{Binding Shakers.OpenCommand}"
  1078. Content="打开"
  1079. FontSize="14"
  1080. Foreground="{StaticResource forecolor}"
  1081. ToolTip="打开增益" />
  1082. <Button
  1083. Width="180"
  1084. Height="48"
  1085. Margin="80,0,0,0"
  1086. Command="{Binding Shakers.CloseCommand}"
  1087. Content="关闭"
  1088. FontSize="14"
  1089. Foreground="{StaticResource forecolor}"
  1090. ToolTip="关闭增益" />
  1091. </StackPanel>
  1092. </UniformGrid>
  1093. <UniformGrid Grid.Row="1" Columns="3">
  1094. <UniformGrid.Resources>
  1095. <system:Double x:Key="size">72</system:Double>
  1096. </UniformGrid.Resources>
  1097. <Button
  1098. Width="{StaticResource size}"
  1099. Height="{StaticResource size}"
  1100. hc:IconElement.Geometry="{StaticResource StartGeometry}"
  1101. Command="{Binding Shakers.StartCommand}"
  1102. Foreground="{StaticResource forecolor}"
  1103. Style="{StaticResource ImageButton}"
  1104. ToolTip="打开功放" />
  1105. <Button
  1106. Width="{StaticResource size}"
  1107. Height="{StaticResource size}"
  1108. hc:IconElement.Geometry="{StaticResource StopGeometry}"
  1109. Command="{Binding Shakers.StopCommand}"
  1110. Foreground="{StaticResource forecolor}"
  1111. Style="{StaticResource ImageButton}"
  1112. ToolTip="关闭功放" />
  1113. <Button
  1114. Width="{StaticResource size}"
  1115. Height="{StaticResource size}"
  1116. hc:IconElement.Geometry="{StaticResource ResetGeometry}"
  1117. Command="{Binding Shakers.ResetCommand}"
  1118. Foreground="{StaticResource forecolor}"
  1119. Style="{StaticResource ImageButton}"
  1120. ToolTip="重置功放错误" />
  1121. </UniformGrid>
  1122. </Grid>
  1123. </GroupBox>
  1124. <GroupBox
  1125. Grid.Column="1"
  1126. Margin="4"
  1127. hc:TitleElement.Background="Transparent"
  1128. hc:TitleElement.MinHeight="36"
  1129. Background="Transparent"
  1130. FontSize="20"
  1131. Foreground="White"
  1132. Header="冷却单元控制"
  1133. Style="{StaticResource GroupBoxTab}">
  1134. <UniformGrid
  1135. Grid.Row="1"
  1136. Height="140"
  1137. Columns="3">
  1138. <UniformGrid.Resources>
  1139. <system:Double x:Key="size">72</system:Double>
  1140. </UniformGrid.Resources>
  1141. <Button
  1142. Width="{StaticResource size}"
  1143. Height="{StaticResource size}"
  1144. hc:IconElement.Geometry="{StaticResource StartGeometry}"
  1145. Command="{Binding Shakers.CoolingWaterStartCommand}"
  1146. Foreground="{StaticResource forecolor}"
  1147. Style="{StaticResource ImageButton}"
  1148. ToolTip="打开冷却单元" />
  1149. <Button
  1150. Width="{StaticResource size}"
  1151. Height="{StaticResource size}"
  1152. hc:IconElement.Geometry="{StaticResource StopGeometry}"
  1153. Command="{Binding Shakers.CoolingWaterStopCommand}"
  1154. Foreground="{StaticResource forecolor}"
  1155. Style="{StaticResource ImageButton}"
  1156. ToolTip="关闭冷却单元" />
  1157. <Button
  1158. Width="{StaticResource size}"
  1159. Height="{StaticResource size}"
  1160. hc:IconElement.Geometry="{StaticResource ResetGeometry}"
  1161. Command="{Binding Shakers.CoolingWaterResetCommand}"
  1162. Foreground="{StaticResource forecolor}"
  1163. Style="{StaticResource ImageButton}"
  1164. ToolTip="重置冷却单元错误" />
  1165. </UniformGrid>
  1166. </GroupBox>
  1167. </Grid>
  1168. <Border Background="{StaticResource ButtonNomalColor}" CornerRadius="6,6,0,0">
  1169. <Grid>
  1170. <TextBlock
  1171. HorizontalAlignment="Center"
  1172. VerticalAlignment="Center"
  1173. FontSize="22"
  1174. Foreground="{StaticResource SystemItemsForeColor}"
  1175. Text="设备控制" />
  1176. <Button
  1177. Margin="0,0,10,0"
  1178. HorizontalAlignment="Right"
  1179. VerticalAlignment="Center"
  1180. hc:IconElement.Geometry="{StaticResource CloseGeometry}"
  1181. Style="{StaticResource ImageButton}"
  1182. ToolTip="关闭">
  1183. <hc:Interaction.Triggers>
  1184. <hc:EventTrigger EventName="Click">
  1185. <hc:SetPropertyAction
  1186. PropertyName="Data"
  1187. PropertyValue="{x:Static system:Boolean.FalseString}"
  1188. TargetObject="{Binding Source={StaticResource DeviceControl}}" />
  1189. </hc:EventTrigger>
  1190. </hc:Interaction.Triggers>
  1191. </Button>
  1192. </Grid>
  1193. </Border>
  1194. <Border
  1195. Grid.Row="2"
  1196. Margin="10,0,10,10"
  1197. BorderBrush="Gray"
  1198. BorderThickness="1"
  1199. CornerRadius="6,6,0,0">
  1200. <ListView
  1201. Foreground="{StaticResource NomalForeColor}"
  1202. ItemsSource="{Binding Shakers.Shakers}"
  1203. TextBlock.FontSize="14">
  1204. <ListView.Style>
  1205. <Style TargetType="ListView" BasedOn="{x:Null}">
  1206. <Setter Property="Background" Value="Transparent" />
  1207. <Setter Property="BorderBrush" Value="Transparent" />
  1208. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  1209. <Setter Property="Padding" Value="0" />
  1210. <Setter Property="Template">
  1211. <Setter.Value>
  1212. <ControlTemplate TargetType="ListView">
  1213. <Grid>
  1214. <Grid.RowDefinitions>
  1215. <RowDefinition Height="42" />
  1216. <RowDefinition Height="*" />
  1217. </Grid.RowDefinitions>
  1218. <Border Background="{StaticResource ButtonNomalColor}" CornerRadius="6,6,0,0">
  1219. <Grid>
  1220. <Grid.ColumnDefinitions>
  1221. <ColumnDefinition Width="66" />
  1222. <ColumnDefinition Width="*" />
  1223. </Grid.ColumnDefinitions>
  1224. <TextBlock
  1225. HorizontalAlignment="Center"
  1226. VerticalAlignment="Center"
  1227. Text="启用" />
  1228. <TextBlock
  1229. Grid.Column="1"
  1230. HorizontalAlignment="Center"
  1231. VerticalAlignment="Center"
  1232. Text="振动台" />
  1233. </Grid>
  1234. </Border>
  1235. <hc:ScrollViewer
  1236. Grid.Row="1"
  1237. HorizontalScrollBarVisibility="Hidden"
  1238. VerticalScrollBarVisibility="Auto">
  1239. <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  1240. </hc:ScrollViewer>
  1241. </Grid>
  1242. </ControlTemplate>
  1243. </Setter.Value>
  1244. </Setter>
  1245. <Setter Property="ItemTemplate">
  1246. <Setter.Value>
  1247. <DataTemplate>
  1248. <Grid IsEnabled="{Binding IsConnected}">
  1249. <Grid.ColumnDefinitions>
  1250. <ColumnDefinition Width="66" />
  1251. <ColumnDefinition Width="*" />
  1252. </Grid.ColumnDefinitions>
  1253. <CheckBox
  1254. HorizontalAlignment="Center"
  1255. VerticalAlignment="Center"
  1256. IsChecked="{Binding IsDeviceControl}" />
  1257. <TextBlock
  1258. Grid.Column="1"
  1259. HorizontalAlignment="Center"
  1260. VerticalAlignment="Center"
  1261. Text="{Binding Description}" />
  1262. </Grid>
  1263. </DataTemplate>
  1264. </Setter.Value>
  1265. </Setter>
  1266. <Setter Property="ItemContainerStyle">
  1267. <Setter.Value>
  1268. <Style TargetType="ListViewItem">
  1269. <Setter Property="Background" Value="Transparent" />
  1270. <Setter Property="BorderBrush" Value="Transparent" />
  1271. <Setter Property="BorderThickness" Value="0" />
  1272. <Setter Property="Height" Value="42" />
  1273. <Setter Property="SnapsToDevicePixels" Value="True" />
  1274. <Setter Property="OverridesDefaultStyle" Value="True" />
  1275. <Setter Property="Cursor" Value="Hand" />
  1276. <Setter Property="IsEnabled" Value="True" />
  1277. <Setter Property="Padding" Value="0" />
  1278. <Setter Property="Template">
  1279. <Setter.Value>
  1280. <ControlTemplate TargetType="ListViewItem">
  1281. <ContentPresenter
  1282. Margin="0,0,0,0"
  1283. Content="{TemplateBinding Content}"
  1284. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  1285. ContentTemplate="{TemplateBinding ContentTemplate}"
  1286. ContentTemplateSelector="{x:Null}"
  1287. IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
  1288. </ControlTemplate>
  1289. </Setter.Value>
  1290. </Setter>
  1291. </Style>
  1292. </Setter.Value>
  1293. </Setter>
  1294. <Setter Property="ItemsPanel">
  1295. <Setter.Value>
  1296. <ItemsPanelTemplate>
  1297. <UniformGrid
  1298. Margin="0"
  1299. Columns="1"
  1300. Style="{x:Null}" />
  1301. </ItemsPanelTemplate>
  1302. </Setter.Value>
  1303. </Setter>
  1304. </Style>
  1305. </ListView.Style>
  1306. </ListView>
  1307. </Border>
  1308. </Grid>
  1309. </Border>
  1310. </Grid>
  1311. </hc:Drawer>
  1312. </Grid>
  1313. </Viewbox>
  1314. </Window>