MainWindow.xaml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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:hc="https://handyorg.github.io/handycontrol"
  7. xmlns:local="clr-namespace:ShakerManger"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:system="clr-namespace:System;assembly=mscorlib"
  10. xmlns:view="clr-namespace:ShakerManger.View"
  11. xmlns:vm="clr-namespace:ShakerManger.ViewModel"
  12. Title="MainWindow"
  13. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  14. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  15. d:DataContext="{d:DesignInstance {x:Type vm:MainWindowViewModel}}"
  16. Background="{StaticResource SystemItemsSelectBackColor}"
  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. <hc:Interaction.Triggers>
  28. <hc:EventTrigger EventName="Closing">
  29. <hc:InvokeCommandAction Command="{Binding CloseCommand}" />
  30. </hc:EventTrigger>
  31. </hc:Interaction.Triggers>
  32. <WindowChrome.WindowChrome>
  33. <WindowChrome
  34. CaptionHeight="0"
  35. CornerRadius="0"
  36. GlassFrameThickness="0"
  37. ResizeBorderThickness="0" />
  38. </WindowChrome.WindowChrome>
  39. <Viewbox Stretch="Fill">
  40. <Grid Width="1920" Height="1080">
  41. <Grid.Style>
  42. <Style TargetType="Grid">
  43. <Style.Triggers>
  44. <MultiDataTrigger>
  45. <MultiDataTrigger.Conditions>
  46. <Condition Binding="{Binding Prompt.IsOpen}" Value="True" />
  47. <Condition Binding="{Binding Login.IsLoggedIn, Converter={StaticResource Boolean2BooleanReConverter}}" Value="True" />
  48. </MultiDataTrigger.Conditions>
  49. <Setter Property="IsEnabled" Value="False" />
  50. </MultiDataTrigger>
  51. <MultiDataTrigger>
  52. <MultiDataTrigger.Conditions>
  53. <Condition Binding="{Binding Prompt.IsOpen}" Value="False" />
  54. <Condition Binding="{Binding Login.IsLoggedIn, Converter={StaticResource Boolean2BooleanReConverter}}" Value="True" />
  55. </MultiDataTrigger.Conditions>
  56. <Setter Property="IsEnabled" Value="False" />
  57. </MultiDataTrigger>
  58. <MultiDataTrigger>
  59. <MultiDataTrigger.Conditions>
  60. <Condition Binding="{Binding Prompt.IsOpen}" Value="True" />
  61. <Condition Binding="{Binding Login.IsLoggedIn, Converter={StaticResource Boolean2BooleanReConverter}}" Value="False" />
  62. </MultiDataTrigger.Conditions>
  63. <Setter Property="IsEnabled" Value="False" />
  64. </MultiDataTrigger>
  65. <MultiDataTrigger>
  66. <MultiDataTrigger.Conditions>
  67. <Condition Binding="{Binding Prompt.IsOpen}" Value="False" />
  68. <Condition Binding="{Binding Login.IsLoggedIn, Converter={StaticResource Boolean2BooleanReConverter}}" Value="False" />
  69. </MultiDataTrigger.Conditions>
  70. <Setter Property="IsEnabled" Value="True" />
  71. </MultiDataTrigger>
  72. </Style.Triggers>
  73. </Style>
  74. </Grid.Style>
  75. <Grid.ColumnDefinitions>
  76. <ColumnDefinition Width="183*" />
  77. <ColumnDefinition Width="217*" />
  78. </Grid.ColumnDefinitions>
  79. <Grid.RowDefinitions>
  80. <RowDefinition Height="66" />
  81. <RowDefinition Height="*" />
  82. </Grid.RowDefinitions>
  83. <Border Grid.ColumnSpan="2" Background="{StaticResource TitleBackColor}">
  84. <Grid>
  85. <Grid.ColumnDefinitions>
  86. <ColumnDefinition Width="500" />
  87. <ColumnDefinition Width="*" />
  88. <ColumnDefinition Width="auto" />
  89. </Grid.ColumnDefinitions>
  90. <TextBlock
  91. Margin="20,0,10,0"
  92. VerticalAlignment="Center"
  93. FontSize="36"
  94. FontWeight="Bold"
  95. Text="{StaticResource Title}" />
  96. <ListView
  97. Grid.Column="1"
  98. Margin="20,0,20,0"
  99. IsEnabled="{Binding IsEnabled}"
  100. ItemsSource="{Binding MainPages}"
  101. SelectedValue="{Binding CurrentMainPage}">
  102. <ListView.Style>
  103. <Style TargetType="ListView" BasedOn="{x:Null}">
  104. <Setter Property="Background" Value="Transparent" />
  105. <Setter Property="BorderBrush" Value="Transparent" />
  106. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  107. <Setter Property="Padding" Value="0" />
  108. <Setter Property="Template">
  109. <Setter.Value>
  110. <ControlTemplate TargetType="ListView">
  111. <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  112. </ControlTemplate>
  113. </Setter.Value>
  114. </Setter>
  115. <Setter Property="ItemTemplate">
  116. <Setter.Value>
  117. <DataTemplate>
  118. <StackPanel
  119. Margin="0"
  120. HorizontalAlignment="Center"
  121. VerticalAlignment="Center"
  122. Background="Transparent"
  123. IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=DataContext.Login.Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
  124. Orientation="Horizontal">
  125. <Viewbox
  126. Width="32"
  127. Height="32"
  128. HorizontalAlignment="Right"
  129. VerticalAlignment="Center">
  130. <Path Data="{Binding IconPath}" Fill="{StaticResource SystemItemsForeColor}" />
  131. </Viewbox>
  132. <TextBlock
  133. Grid.Column="1"
  134. Margin="20,0,0,0"
  135. HorizontalAlignment="Left"
  136. VerticalAlignment="Center"
  137. FontSize="22"
  138. Foreground="{StaticResource SystemItemsForeColor}"
  139. Text="{Binding MainPageType, Converter={StaticResource EnumToDescription}}" />
  140. </StackPanel>
  141. </DataTemplate>
  142. </Setter.Value>
  143. </Setter>
  144. <Setter Property="ItemContainerStyle">
  145. <Setter.Value>
  146. <Style TargetType="ListViewItem">
  147. <Setter Property="Background" Value="Transparent" />
  148. <Setter Property="BorderBrush" Value="Transparent" />
  149. <Setter Property="BorderThickness" Value="0" />
  150. <Setter Property="SnapsToDevicePixels" Value="True" />
  151. <Setter Property="OverridesDefaultStyle" Value="True" />
  152. <Setter Property="Cursor" Value="Hand" />
  153. <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
  154. <Setter Property="Padding" Value="0" />
  155. <Setter Property="Template">
  156. <Setter.Value>
  157. <ControlTemplate TargetType="ListViewItem">
  158. <Border
  159. x:Name="backcolor"
  160. Margin="0"
  161. Padding="0"
  162. CornerRadius="12,12,0,0">
  163. <ContentPresenter
  164. Margin="0"
  165. Content="{TemplateBinding Content}"
  166. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  167. ContentTemplate="{TemplateBinding ContentTemplate}"
  168. ContentTemplateSelector="{x:Null}"
  169. IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=DataContext.Login.Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
  170. </Border>
  171. <ControlTemplate.Triggers>
  172. <Trigger Property="IsSelected" Value="True">
  173. <Setter TargetName="backcolor" Property="Background" Value="{StaticResource SystemItemsSelectBackColor}" />
  174. </Trigger>
  175. </ControlTemplate.Triggers>
  176. </ControlTemplate>
  177. </Setter.Value>
  178. </Setter>
  179. </Style>
  180. </Setter.Value>
  181. </Setter>
  182. <Setter Property="ItemsPanel">
  183. <Setter.Value>
  184. <ItemsPanelTemplate>
  185. <UniformGrid
  186. Margin="0"
  187. Rows="1"
  188. Style="{x:Null}" />
  189. </ItemsPanelTemplate>
  190. </Setter.Value>
  191. </Setter>
  192. </Style>
  193. </ListView.Style>
  194. </ListView>
  195. <StackPanel
  196. Grid.Column="2"
  197. Margin="40,0,10,0"
  198. VerticalAlignment="Center"
  199. Orientation="Horizontal">
  200. <Grid>
  201. <Button
  202. Width="42"
  203. Height="42"
  204. 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"
  205. Command="{Binding SaveDataCommand}"
  206. Cursor="Hand"
  207. IsEnabled="{Binding IsEnabled}"
  208. Style="{StaticResource ImageButton}" />
  209. <Viewbox
  210. Width="20"
  211. Height="20"
  212. Margin="0,10,0,0"
  213. IsHitTestVisible="False"
  214. Visibility="{Binding IsSaveData, Converter={StaticResource Boolean2VisibilityConverter}}">
  215. <Path
  216. 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"
  217. Fill="Green"
  218. RenderTransformOrigin="0.5,0.5">
  219. <Path.RenderTransform>
  220. <TransformGroup>
  221. <ScaleTransform />
  222. <SkewTransform />
  223. <RotateTransform Angle="0" />
  224. <TranslateTransform />
  225. </TransformGroup>
  226. </Path.RenderTransform>
  227. <Path.Triggers>
  228. <EventTrigger RoutedEvent="Loaded">
  229. <BeginStoryboard>
  230. <Storyboard>
  231. <DoubleAnimation
  232. AutoReverse="False"
  233. RepeatBehavior="Forever"
  234. SpeedRatio="1"
  235. Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
  236. From="0"
  237. To="360"
  238. Duration="0:0:1" />
  239. </Storyboard>
  240. </BeginStoryboard>
  241. </EventTrigger>
  242. </Path.Triggers>
  243. </Path>
  244. </Viewbox>
  245. </Grid>
  246. <Button
  247. Width="42"
  248. Height="42"
  249. Margin="20,0,0,0"
  250. VerticalAlignment="Center"
  251. hc:IconElement.Geometry="{StaticResource LayoutGeometry}"
  252. Background="{StaticResource TitleBackColor}"
  253. Cursor="Hand"
  254. IsEnabled="{Binding LayoutVisibily}"
  255. Style="{StaticResource ImageButton}">
  256. <hc:Interaction.Triggers>
  257. <hc:EventTrigger EventName="Click">
  258. <hc:SetPropertyAction
  259. PropertyName="IsOpen"
  260. PropertyValue="{x:Static system:Boolean.TrueString}"
  261. TargetObject="{Binding LayoutManger}" />
  262. </hc:EventTrigger>
  263. </hc:Interaction.Triggers>
  264. </Button>
  265. <Button
  266. Width="42"
  267. Height="42"
  268. Margin="20,0,0,0"
  269. VerticalAlignment="Center"
  270. hc:IconElement.Geometry="{StaticResource CloseGeometry}"
  271. Background="{StaticResource TitleBackColor}"
  272. Command="{Binding ExitCommand}"
  273. Cursor="Hand"
  274. Style="{StaticResource ImageButton}"
  275. ToolTip="关闭" />
  276. <Popup
  277. AllowsTransparency="True"
  278. IsOpen="{Binding LayoutManger.IsOpen}"
  279. Placement="Mouse"
  280. PopupAnimation="Slide"
  281. StaysOpen="False">
  282. <ContentControl Content="{Binding LayoutManger.View, Converter={StaticResource Type2ViewConverter}}" />
  283. </Popup>
  284. </StackPanel>
  285. </Grid>
  286. </Border>
  287. <ContentControl
  288. Grid.Row="1"
  289. Grid.ColumnSpan="2"
  290. Content="{Binding CurrentMainPage.View, Converter={StaticResource Type2ViewConverter}}"
  291. IsEnabled="{Binding IsEnabled}" />
  292. <Popup
  293. Grid.Row="0"
  294. Grid.RowSpan="2"
  295. Grid.ColumnSpan="2"
  296. AllowsTransparency="True"
  297. IsOpen="{Binding Source={StaticResource MainViewModel}, Path=Data.Shakers.SelectedIsOpen}"
  298. Placement="Mouse"
  299. PopupAnimation="Slide"
  300. StaysOpen="False">
  301. <view:ShakerSelectView DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data.Shakers}" />
  302. </Popup>
  303. <Popup
  304. Grid.Row="0"
  305. Grid.RowSpan="2"
  306. Grid.ColumnSpan="2"
  307. AllowsTransparency="True"
  308. IsOpen="{Binding Source={StaticResource ColorPicker}, Path=IsOpen}"
  309. Placement="Mouse"
  310. PopupAnimation="Slide"
  311. StaysOpen="True">
  312. <view:ColorPickerView DataContext="{Binding Source={StaticResource ColorPicker}}" />
  313. </Popup>
  314. <hc:Drawer
  315. Grid.Row="0"
  316. Grid.RowSpan="2"
  317. Grid.ColumnSpan="2"
  318. Dock="Top"
  319. IsOpen="{Binding Prompt.IsOpen}">
  320. <Border
  321. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  322. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  323. Background="#9FAAAAAA">
  324. <Border
  325. Width="560"
  326. Height="340"
  327. Background="Gray"
  328. CornerRadius="6">
  329. <Grid>
  330. <Grid.RowDefinitions>
  331. <RowDefinition Height="66" />
  332. <RowDefinition Height="2*" />
  333. <RowDefinition Height="*" />
  334. </Grid.RowDefinitions>
  335. <Border
  336. Grid.ColumnSpan="2"
  337. Background="{StaticResource TitleBackColor}"
  338. CornerRadius="6,6,0,0">
  339. <TextBlock
  340. HorizontalAlignment="Center"
  341. VerticalAlignment="Center"
  342. FontSize="32"
  343. FontWeight="Bold"
  344. Foreground="White"
  345. Text="{Binding Prompt.Title}" />
  346. </Border>
  347. <StackPanel
  348. Grid.Row="1"
  349. HorizontalAlignment="Center"
  350. VerticalAlignment="Center"
  351. Orientation="Horizontal">
  352. <Viewbox
  353. Grid.Row="1"
  354. Grid.Column="0"
  355. Width="60"
  356. Height="60"
  357. HorizontalAlignment="Center"
  358. VerticalAlignment="Center"
  359. Visibility="{Binding Prompt.IconVisibility}">
  360. <Path Data="{Binding Prompt.IconGeometry, Mode=OneWay}" Fill="{Binding Prompt.IconBrush}" />
  361. </Viewbox>
  362. <TextBlock
  363. Grid.Row="1"
  364. Grid.Column="1"
  365. MaxWidth="420"
  366. Margin="20"
  367. HorizontalAlignment="Left"
  368. VerticalAlignment="Center"
  369. FontSize="20"
  370. Foreground="White"
  371. Text="{Binding Prompt.Message}"
  372. TextWrapping="Wrap" />
  373. </StackPanel>
  374. <StackPanel
  375. Grid.Row="2"
  376. Grid.ColumnSpan="2"
  377. HorizontalAlignment="Center"
  378. VerticalAlignment="Center"
  379. Orientation="Horizontal">
  380. <Button
  381. Width="88"
  382. Height="38"
  383. Command="{Binding Prompt.YesCommand}"
  384. Content="{Binding Prompt.YesText}"
  385. Cursor="Hand"
  386. FontSize="16"
  387. ToolTip="{Binding Prompt.YesText}"
  388. Visibility="{Binding Prompt.YesVisibility}" />
  389. <Button
  390. Width="88"
  391. Height="38"
  392. Margin="40,0,0,0"
  393. Command="{Binding Prompt.NoCommand}"
  394. Content="{Binding Prompt.NoText}"
  395. Cursor="Hand"
  396. FontSize="16"
  397. ToolTip="{Binding Prompt.NoText}"
  398. Visibility="{Binding Prompt.NoVisibility}" />
  399. </StackPanel>
  400. </Grid>
  401. </Border>
  402. </Border>
  403. </hc:Drawer>
  404. <hc:Drawer
  405. Grid.Row="0"
  406. Grid.RowSpan="2"
  407. Grid.ColumnSpan="2"
  408. Dock="Top"
  409. IsOpen="{Binding Login.IsLoggedIn, Converter={StaticResource Boolean2BooleanReConverter}}">
  410. <Grid
  411. Width="{x:Static SystemParameters.PrimaryScreenWidth}"
  412. Height="{x:Static SystemParameters.PrimaryScreenHeight}"
  413. Background="#9FAAAAAA">
  414. <Grid Width="620" Height="440">
  415. <Border
  416. Background="White"
  417. BorderBrush="{StaticResource BorderBrush}"
  418. BorderThickness="1"
  419. CornerRadius="6">
  420. <Border.Effect>
  421. <BlurEffect
  422. KernelType="Box"
  423. Radius="1"
  424. RenderingBias="Quality" />
  425. </Border.Effect>
  426. </Border>
  427. <Grid
  428. Width="400"
  429. Height="420"
  430. Margin="10"
  431. HorizontalAlignment="Center"
  432. VerticalAlignment="Center">
  433. <Grid.RowDefinitions>
  434. <RowDefinition Height="100" />
  435. <RowDefinition />
  436. <RowDefinition />
  437. <RowDefinition Height="32" />
  438. <RowDefinition />
  439. </Grid.RowDefinitions>
  440. <TextBlock
  441. HorizontalAlignment="Center"
  442. VerticalAlignment="Center"
  443. FontSize="42"
  444. Foreground="{StaticResource TitleBrush}"
  445. Text="用户登录" />
  446. <StackPanel
  447. Grid.Row="1"
  448. Height="42"
  449. Orientation="Horizontal">
  450. <TextBlock
  451. HorizontalAlignment="Right"
  452. VerticalAlignment="Center"
  453. FontSize="16"
  454. Text="用户名:" />
  455. <hc:WatermarkTextBox
  456. Width="320"
  457. Height="32"
  458. Margin="10,0,0,0"
  459. VerticalAlignment="Center"
  460. VerticalContentAlignment="Center"
  461. hc:BorderElement.CornerRadius="4"
  462. BorderBrush="{StaticResource BorderBrush}"
  463. BorderThickness="1"
  464. CaretBrush="Black"
  465. FontSize="16"
  466. Foreground="Black"
  467. InputScope="AlphanumericHalfWidth"
  468. MaxLength="20"
  469. Text="{Binding Login.UserName}"
  470. Watermark="输入用户名" />
  471. </StackPanel>
  472. <StackPanel
  473. Grid.Row="2"
  474. Height="42"
  475. Orientation="Horizontal">
  476. <TextBlock
  477. HorizontalAlignment="Right"
  478. VerticalAlignment="Center"
  479. FontSize="16"
  480. Text=" 密码:" />
  481. <hc:PasswordBox
  482. Width="320"
  483. Height="32"
  484. Margin="10,0,0,0"
  485. VerticalAlignment="Center"
  486. VerticalContentAlignment="Center"
  487. hc:InfoElement.Placeholder="输入密码"
  488. Background="Transparent"
  489. BorderBrush="{StaticResource BorderBrush}"
  490. BorderThickness="1"
  491. CaretBrush="Black"
  492. FontSize="16"
  493. Foreground="Black"
  494. IsSafeEnabled="False"
  495. MaxLength="20"
  496. ShowEyeButton="True"
  497. UnsafePassword="{Binding Login.PassWord}" />
  498. </StackPanel>
  499. <TextBlock
  500. Grid.Row="3"
  501. Foreground="Red"
  502. Text="{Binding Login.Message}" />
  503. <StackPanel
  504. Grid.Row="4"
  505. HorizontalAlignment="Center"
  506. VerticalAlignment="Center"
  507. Orientation="Horizontal">
  508. <Button
  509. Width="120"
  510. Height="36"
  511. Command="{Binding Login.LoginCommand}"
  512. Content="登录"
  513. Cursor="Hand"
  514. Foreground="Black" />
  515. <Button
  516. Width="120"
  517. Height="36"
  518. Margin="40,0,0,0"
  519. Command="{Binding ShutDownCommand}"
  520. Content="退出"
  521. Cursor="Hand"
  522. Foreground="Black" />
  523. </StackPanel>
  524. </Grid>
  525. </Grid>
  526. <Button
  527. Margin="0,0,10,10"
  528. HorizontalAlignment="Right"
  529. VerticalAlignment="Bottom"
  530. BorderThickness="0"
  531. Command="{Binding Login.AnonymousLoginCommand}"
  532. Content="匿名登录"
  533. FontSize="22"
  534. Foreground="Blue"
  535. ToolTip="匿名登录">
  536. <Button.Style>
  537. <Style TargetType="{x:Type Button}">
  538. <Setter Property="Cursor" Value="Hand" />
  539. <Setter Property="Template">
  540. <Setter.Value>
  541. <ControlTemplate TargetType="{x:Type Button}">
  542. <TextBlock
  543. x:Name="text"
  544. Text="{TemplateBinding Content}"
  545. TextDecorations="Underline" />
  546. <ControlTemplate.Triggers>
  547. <Trigger Property="IsMouseOver" Value="True">
  548. <Setter TargetName="text" Property="Foreground" Value="Red" />
  549. </Trigger>
  550. </ControlTemplate.Triggers>
  551. </ControlTemplate>
  552. </Setter.Value>
  553. </Setter>
  554. </Style>
  555. </Button.Style>
  556. </Button>
  557. </Grid>
  558. </hc:Drawer>
  559. </Grid>
  560. </Viewbox>
  561. </Window>