AuthorizationWindow.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <Window x:Class="InteractiveKiosk.AuthorizationWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:InteractiveKiosk"
  7. mc:Ignorable="d"
  8. Height="300" Width="400" AllowsTransparency="True" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Icon="Logo.png" WindowStyle="None" Background="Transparent">
  9. <Window.Resources>
  10. <Style x:Key="TextBox" TargetType="TextBox">
  11. <Setter Property="Background" Value="White"/>
  12. <Setter Property="VerticalContentAlignment" Value="Center"/>
  13. <Setter Property="Height" Value="23"/>
  14. <Setter Property="Foreground" Value="Black"/>
  15. <Setter Property="FontSize" Value="13"/>
  16. <Setter Property="Padding" Value="10,0,0,0"/>
  17. <Setter Property="BorderBrush" Value="Black"/>
  18. <Setter Property="Template">
  19. <Setter.Value>
  20. <ControlTemplate TargetType="TextBox">
  21. <Grid x:Name="root" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" SnapsToDevicePixels="True">
  22. <Border x:Name="Background" BorderThickness="1" CornerRadius="15" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"/>
  23. <ScrollViewer x:Name="PART_ContentHost" BorderThickness="0" Padding="{TemplateBinding Padding}" IsTabStop="False" Background="{x:Null}" TextElement.Foreground="{TemplateBinding Foreground}"/>
  24. </Grid>
  25. <ControlTemplate.Triggers>
  26. <Trigger Property="IsFocused" Value="True">
  27. <Setter Property="BorderBrush" Value="Black"/>
  28. <Setter Property="Background" Value="White"/>
  29. </Trigger>
  30. </ControlTemplate.Triggers>
  31. </ControlTemplate>
  32. </Setter.Value>
  33. </Setter>
  34. </Style>
  35. <Style x:Key="Password" TargetType="PasswordBox">
  36. <Setter Property="Background" Value="White"/>
  37. <Setter Property="VerticalContentAlignment" Value="Center"/>
  38. <Setter Property="Height" Value="23"/>
  39. <Setter Property="Foreground" Value="Black"/>
  40. <Setter Property="FontSize" Value="13"/>
  41. <Setter Property="BorderBrush" Value="Black"/>
  42. <Setter Property="Padding" Value="10,0,0,0"/>
  43. <EventSetter Event="PasswordChanged" Handler="OnPasswordChanged"/>
  44. <Setter Property="Template">
  45. <Setter.Value>
  46. <ControlTemplate TargetType="PasswordBox">
  47. <Grid x:Name="root" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" SnapsToDevicePixels="True">
  48. <Border x:Name="Background" BorderThickness="1" CornerRadius="15" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"/>
  49. <ScrollViewer x:Name="PART_ContentHost" BorderThickness="0" Padding="{TemplateBinding Padding}" IsTabStop="False" Background="{x:Null}" TextElement.Foreground="{TemplateBinding Foreground}"/>
  50. </Grid>
  51. <ControlTemplate.Triggers>
  52. <Trigger Property="IsFocused" Value="True">
  53. <Setter Property="BorderBrush" Value="Black"/>
  54. <Setter Property="Background" Value="White"/>
  55. </Trigger>
  56. </ControlTemplate.Triggers>
  57. </ControlTemplate>
  58. </Setter.Value>
  59. </Setter>
  60. </Style>
  61. </Window.Resources>
  62. <Grid Name="Authorization" Background="Transparent" MouseDown="Authorization_MouseDown">
  63. <Border CornerRadius="20" BorderBrush="Black" BorderThickness="0">
  64. <Border.Background>
  65. <ImageBrush ImageSource="file.jpg"/>
  66. </Border.Background>
  67. <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="АВТОРИЗАЦИЯ" VerticalAlignment="Top" Height="29" Width="150" Margin="130,28,0,0" FontSize="20" FontFamily="Segoe UI Semilight"/>
  68. </Border>
  69. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Width="69">
  70. <Image Name="MinButton" Height="23" Width="20" Margin="5,-255,-13,0" MouseDown="MinButton_MouseDown">
  71. <Image.Style>
  72. <Style TargetType="{x:Type Image}">
  73. <Setter Property="Source" Value="Resources/min(inactive).png"/>
  74. <Style.Triggers>
  75. <DataTrigger Binding="{Binding IsMouseOver, ElementName=MinButton}"
  76. Value="True">
  77. <Setter Property="Source" Value="Resources/min.png"/>
  78. </DataTrigger>
  79. </Style.Triggers>
  80. </Style>
  81. </Image.Style>
  82. </Image>
  83. <Image Name="ExitButton" Height="23" Width="20" Margin="20,-255,20,0" MouseDown="ExitButton_MouseDown">
  84. <Image.Style>
  85. <Style TargetType="{x:Type Image}">
  86. <Setter Property="Source" Value="Resources/exit(inactive).png"/>
  87. <Style.Triggers>
  88. <DataTrigger Binding="{Binding IsMouseOver, ElementName=ExitButton}"
  89. Value="True">
  90. <Setter Property="Source" Value="Resources/exit.png"/>
  91. </DataTrigger>
  92. </Style.Triggers>
  93. </Style>
  94. </Image.Style>
  95. </Image>
  96. </StackPanel>
  97. <Border Name="LogButton" Width="106" BorderThickness="1" Background="Black" CornerRadius="15" Margin="250,201,44,66">
  98. <Border.Style>
  99. <Style TargetType="{x:Type Border}">
  100. <Setter Property="BorderBrush" Value="Black"/>
  101. <Style.Triggers>
  102. <EventTrigger RoutedEvent="PreviewMouseDown">
  103. <BeginStoryboard>
  104. <Storyboard>
  105. <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" Duration="0:0:0.100" To="Gray"/>
  106. </Storyboard>
  107. </BeginStoryboard>
  108. </EventTrigger>
  109. <EventTrigger RoutedEvent="PreviewMouseUp">
  110. <BeginStoryboard>
  111. <Storyboard>
  112. <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" Duration="0:0:0.100" To="Black"/>
  113. </Storyboard>
  114. </BeginStoryboard>
  115. </EventTrigger>
  116. </Style.Triggers>
  117. </Style>
  118. </Border.Style>
  119. <Button Content="Войти" FontSize="14" Foreground="Black" FontFamily="Segoe UI Semilight" Click="LoginButton">
  120. <Button.Style>
  121. <Style TargetType="Button">
  122. <Setter Property="OverridesDefaultStyle" Value="True"/>
  123. <Setter Property="Background" Value="White"/>
  124. <Setter Property="Template">
  125. <Setter.Value>
  126. <ControlTemplate TargetType="Button">
  127. <Border Name="Border" BorderThickness="0" BorderBrush="Black" CornerRadius="15" Background="{TemplateBinding Background}">
  128. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  129. </Border>
  130. <ControlTemplate.Triggers>
  131. <Trigger Property="IsMouseOver" Value="True">
  132. <Setter Property="Background" Value="Gray"/>
  133. </Trigger>
  134. <EventTrigger RoutedEvent="PreviewMouseDown">
  135. <BeginStoryboard>
  136. <Storyboard>
  137. <ThicknessAnimation Storyboard.TargetProperty="Margin" Duration="0:0:0.100" To="2, 2, 0, 0"/>
  138. <ColorAnimation Storyboard.TargetProperty="Background.Color" To="Gray" Duration="0:0:0.0002"/>
  139. </Storyboard>
  140. </BeginStoryboard>
  141. </EventTrigger>
  142. <EventTrigger RoutedEvent="PreviewMouseUp">
  143. <BeginStoryboard>
  144. <Storyboard>
  145. <ThicknessAnimation Storyboard.TargetProperty="Margin" Duration="0:0:0.100" To="0, 0, 0, 0"/>
  146. <ColorAnimation Storyboard.TargetProperty="Background.Color" To="White" Duration="0:0:0.0002"/>
  147. </Storyboard>
  148. </BeginStoryboard>
  149. </EventTrigger>
  150. </ControlTemplate.Triggers>
  151. </ControlTemplate>
  152. </Setter.Value>
  153. </Setter>
  154. </Style>
  155. </Button.Style>
  156. </Button>
  157. </Border>
  158. <TextBox x:Name="Login" Style="{StaticResource TextBox}" Margin="173,98,23,169" Height="Auto"/>
  159. <TextBlock IsHitTestVisible="False" FontSize="14" Text="Логин" VerticalAlignment="Top" Foreground="Gray" Margin="186,105,35,0" FontFamily="Segoe UI Semilight">
  160. <TextBlock.Style>
  161. <Style TargetType="{x:Type TextBlock}">
  162. <Setter Property="Visibility" Value="Collapsed"/>
  163. <Style.Triggers>
  164. <DataTrigger Binding="{Binding Text, ElementName=Login}" Value="">
  165. <Setter Property="Visibility" Value="Visible"/>
  166. </DataTrigger>
  167. </Style.Triggers>
  168. </Style>
  169. </TextBlock.Style>
  170. </TextBlock>
  171. <PasswordBox x:Name="Password" Style="{StaticResource Password}" Margin="173,136,23,131" Height="Auto"/>
  172. <TextBlock Name="Watermark" IsHitTestVisible="False" FontSize="14" Text="Пароль" VerticalAlignment="Top" Foreground="Gray" Margin="186,144,35,0" FontFamily="Segoe UI Semilight">
  173. </TextBlock>
  174. <TextBlock HorizontalAlignment="Left" Margin="23,105,0,0" TextWrapping="Wrap" Text="Имя пользователя:" VerticalAlignment="Top" Height="23" Width="145" FontSize="14" FontFamily="Segoe UI Semilight"/>
  175. <TextBlock HorizontalAlignment="Left" Margin="23,144,0,0" TextWrapping="Wrap" Text="Пароль:" VerticalAlignment="Top" Height="23" Width="127" FontSize="14" FontFamily="Segoe UI Semilight"/>
  176. <ToggleButton Name="Check" Content="Показать пароль" Height="33" Width="164" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="44,203,0,0" Foreground="Black" Checked="PasswordChecked" FontSize="14" FontFamily="Segoe UI Semilight">
  177. <ToggleButton.Template>
  178. <ControlTemplate TargetType="{x:Type ToggleButton}">
  179. <StackPanel Orientation="Horizontal">
  180. <Border Height="28" Width="30" CornerRadius="15" HorizontalAlignment="Left" BorderThickness="1" Background="Transparent">
  181. <Border.Style>
  182. <Style TargetType="{x:Type Border}">
  183. <Setter Property="BorderBrush" Value="Black"/>
  184. <Style.Triggers>
  185. <Trigger Property="IsMouseOver" Value="True">
  186. <Setter Property="BorderBrush" Value="Gray"/>
  187. </Trigger>
  188. <EventTrigger RoutedEvent="PreviewMouseDown">
  189. <BeginStoryboard>
  190. <Storyboard>
  191. <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" To="Black" Duration="0:0:0.100"/>
  192. </Storyboard>
  193. </BeginStoryboard>
  194. </EventTrigger>
  195. <EventTrigger RoutedEvent="PreviewMouseUp">
  196. <BeginStoryboard>
  197. <Storyboard>
  198. <ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" To="White" Duration="0:0:0.100"/>
  199. </Storyboard>
  200. </BeginStoryboard>
  201. </EventTrigger>
  202. </Style.Triggers>
  203. </Style>
  204. </Border.Style>
  205. <Image Margin="2">
  206. <Image.Style>
  207. <Style>
  208. <Style.Triggers>
  209. <DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}" Value="True">
  210. <Setter Property="Image.Source" Value="Resources/checked.png"/>
  211. </DataTrigger>
  212. </Style.Triggers>
  213. </Style>
  214. </Image.Style>
  215. </Image>
  216. </Border>
  217. <ContentPresenter Content="{TemplateBinding Content}" Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
  218. </StackPanel>
  219. </ControlTemplate>
  220. </ToggleButton.Template>
  221. </ToggleButton>
  222. <Image x:Name="man" Margin="60,24,300,236">
  223. <Image.Source>
  224. <FormatConvertedBitmap Source="C:\Users\locadm\Source\Repos\InteractiveKiosk9\InteractiveKiosk\Resources\people.png"/>
  225. </Image.Source>
  226. </Image>
  227. </Grid>
  228. </Window>