PasswordMsgBox.xaml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <Window x:Class="MECF.Framework.UI.Core.Accounts.PasswordMsgBox"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:aero="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
  5. xmlns:tb="http://www.hardcodet.net/taskbar"
  6. xmlns:validationRules2="clr-namespace:Aitex.Core.UI.ValidationRules"
  7. Width="400" Height="350"
  8. WindowStyle="None"
  9. Background="{StaticResource loginBackgroundImg}"
  10. ShowInTaskbar="True"
  11. WindowStartupLocation="CenterScreen"
  12. WindowState="Normal" ResizeMode="NoResize">
  13. <Window.Resources>
  14. <Style TargetType="{x:Type PasswordBox}">
  15. <Setter Property="FontSize" Value="20"></Setter>
  16. <Setter Property="Padding" Value="1,5,0,0"></Setter>
  17. <Setter Property="Background">
  18. <Setter.Value>
  19. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/输入框.png">
  20. </ImageBrush>
  21. </Setter.Value>
  22. </Setter>
  23. </Style>
  24. <Style TargetType="Label">
  25. <Setter Property="FontSize" Value="20"/>
  26. <Setter Property="FontFamily" Value="Arial,SimSun" />
  27. <Setter Property="Foreground" Value="Black"></Setter>
  28. </Style>
  29. <Style TargetType="TextBox">
  30. <Setter Property="Template">
  31. <Setter.Value>
  32. <ControlTemplate TargetType="TextBoxBase">
  33. <aero:ListBoxChrome Background="{TemplateBinding Control.Background}" BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="{TemplateBinding Control.BorderThickness}" Name="Bd" RenderFocused="{TemplateBinding UIElement.IsKeyboardFocusWithin}" RenderMouseOver="{TemplateBinding UIElement.IsMouseOver}" SnapsToDevicePixels="True">
  34. <ScrollViewer Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  35. </aero:ListBoxChrome>
  36. <ControlTemplate.Triggers>
  37. <Trigger Property="UIElement.IsEnabled" Value="False">
  38. <Setter Property="aero:ListBoxChrome.Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
  39. <Setter Property="Control.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  40. </Trigger>
  41. </ControlTemplate.Triggers>
  42. </ControlTemplate>
  43. </Setter.Value>
  44. </Setter>
  45. <Setter Property="FontSize" Value="20"></Setter>
  46. <Setter Property="Padding" Value="1,5,0,0"></Setter>
  47. <Setter Property="Background">
  48. <Setter.Value>
  49. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/输入框.png">
  50. </ImageBrush>
  51. </Setter.Value>
  52. </Setter>
  53. <Style.Triggers>
  54. <Trigger Property="IsFocused" Value="True">
  55. <Setter Property="Background">
  56. <Setter.Value>
  57. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/输入框_选择.png">
  58. </ImageBrush>
  59. </Setter.Value>
  60. </Setter>
  61. </Trigger>
  62. </Style.Triggers>
  63. </Style>
  64. <Style TargetType="Button">
  65. <Setter Property="Background">
  66. <Setter.Value>
  67. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/按钮.png"/>
  68. </Setter.Value>
  69. </Setter>
  70. <Style.Triggers>
  71. <Trigger Property="IsMouseOver" Value="true">
  72. <Setter Property="Background">
  73. <Setter.Value>
  74. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/按钮_悬停.png"></ImageBrush>
  75. </Setter.Value>
  76. </Setter>
  77. </Trigger>
  78. <Trigger Property="IsFocused" Value="true">
  79. <Setter Property="Background">
  80. <Setter.Value>
  81. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/按钮_点击.png"></ImageBrush>
  82. </Setter.Value>
  83. </Setter>
  84. </Trigger>
  85. </Style.Triggers>
  86. </Style>
  87. <!--登录窗口样式-->
  88. <Style TargetType="Button" x:Key="LoginButton">
  89. <Setter Property="Cursor" Value="Hand"/>
  90. <Setter Property="BorderBrush" Value="Blue" />
  91. <Setter Property="Margin" Value="5"/>
  92. <Setter Property="FontFamily" Value="Arial,SimSun" />
  93. <Setter Property="FontSize" Value="14"/>
  94. <Setter Property="VerticalAlignment" Value="Top" />
  95. <Setter Property="Height" Value="40"></Setter>
  96. <Setter Property="Width" Value="116"></Setter>
  97. <Setter Property="Background">
  98. <Setter.Value>
  99. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/按钮.png" />
  100. </Setter.Value>
  101. </Setter>
  102. <Setter Property="Template">
  103. <Setter.Value>
  104. <ControlTemplate TargetType="ButtonBase">
  105. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  106. <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" Margin="{TemplateBinding Control.Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" />
  107. </Border>
  108. </ControlTemplate>
  109. </Setter.Value>
  110. </Setter>
  111. <Style.Triggers>
  112. <Trigger Property="IsMouseOver" Value="True">
  113. <Setter Property="Background" >
  114. <Setter.Value>
  115. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/按钮_悬停.png">
  116. </ImageBrush>
  117. </Setter.Value>
  118. </Setter>
  119. </Trigger>
  120. <!-- When the mouse is pressed, apply a bevel with a narrower BevelWidth to make the button appear to get pressed. -->
  121. <Trigger Property="IsFocused" Value="true">
  122. <Setter Property="Background" >
  123. <Setter.Value>
  124. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/按钮_点击.png">
  125. </ImageBrush>
  126. </Setter.Value>
  127. </Setter>
  128. </Trigger>
  129. </Style.Triggers>
  130. </Style>
  131. </Window.Resources>
  132. <Grid>
  133. <Canvas x:Name="canvas" Width="390" Height="340" >
  134. <Label Canvas.Left="78" Canvas.Top="88" Height="40" Name="label2" Width="240" Foreground="White" Content="{DynamicResource GlobalLableUserPassword}" />
  135. <PasswordBox Canvas.Left="78" Canvas.Top="144" Height="40" Name="passwordBox" Width="190" >
  136. <PasswordBox.Template>
  137. <ControlTemplate TargetType="PasswordBox" >
  138. <aero:ListBoxChrome Background="{TemplateBinding Control.Background}" BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="{TemplateBinding Control.BorderThickness}" Name="Bd" RenderFocused="{TemplateBinding UIElement.IsKeyboardFocusWithin}" RenderMouseOver="{TemplateBinding UIElement.IsMouseOver}" SnapsToDevicePixels="True">
  139. <ScrollViewer Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  140. </aero:ListBoxChrome>
  141. <ControlTemplate.Triggers>
  142. <Trigger Property="IsFocused" Value="True">
  143. <Setter Property="Background" >
  144. <Setter.Value>
  145. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.UI.Core;component/Resources/Login/输入框_选择.png">
  146. </ImageBrush>
  147. </Setter.Value>
  148. </Setter>
  149. </Trigger>
  150. </ControlTemplate.Triggers>
  151. </ControlTemplate>
  152. </PasswordBox.Template>
  153. </PasswordBox>
  154. <Button Click="OnLoginClicked" FontSize="18" Style="{StaticResource LoginButton}" Canvas.Left="49" Canvas.Top="290" Height="40" Width="116" FontWeight="Bold" Content="{DynamicResource GlobalLableButtonLogin}" IsDefault="True"/>
  155. <Button FontSize="20" Style="{StaticResource LoginButton}" Canvas.Left="233" Canvas.Top="290" Click="OnExitClicked" Height="40" Width="116" FontWeight="Bold" Content="{DynamicResource GlobalLableButtonExit}"/>
  156. <Label Canvas.Left="135" Height="40" Width="160" Content="{DynamicResource GlobalLableUserLogin}" />
  157. <Label Canvas.Left="28" Canvas.Top="224" Content="" Height="40" Name="LabelResult" Width="307" Foreground="White" />
  158. </Canvas>
  159. </Grid>
  160. </Window>