ChangeUserWindow.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <Window x:Class="CCDCountWpf.WpfFrom.ChangeUserWindow"
  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:CCDCountWpf.WpfFrom"
  7. mc:Ignorable="d"
  8. Title="ChangeUserWindow" Height="430" Width="450" ResizeMode="NoResize"
  9. WindowStartupLocation="CenterScreen" Icon="/FromImage/mmexport1752891278116.jpg" Loaded="Window_Loaded">
  10. <Grid Background="#FF2C3E50">
  11. <Grid Height="60" VerticalAlignment="Top" Background="#FF2980B9">
  12. <Label Content="{DynamicResource EditUser}" Margin="0,15,0,0" FontWeight="Bold" FontSize="20" VerticalAlignment="Top" HorizontalAlignment="Center" Grid.Column="1" Foreground="White"/>
  13. </Grid>
  14. <StackPanel Orientation="Horizontal" Margin="0,60,0,0" HorizontalAlignment="Center">
  15. <StackPanel HorizontalAlignment="Left" Margin="0,0,0,0">
  16. <Label Content="ID:" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  17. <Label Content="{DynamicResource Username}" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  18. <Label Content="{DynamicResource PreviousPassword}" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  19. <Label Content="{DynamicResource NewPassword}" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  20. <Label Content="{DynamicResource RetypeNewPassword}" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  21. <Label Content="{DynamicResource Permission}" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  22. </StackPanel>
  23. <StackPanel HorizontalAlignment="Left" Margin="10,0,0,0">
  24. <TextBox x:Name="UserIDTbx" HorizontalAlignment="Left" Margin="0,15,0,0" Width="120" FontWeight="Bold" FontSize="20" Background="{x:Null}" IsReadOnly="True" Foreground="White"/>
  25. <TextBox x:Name="UserNameTbx" HorizontalAlignment="Left" Margin="0,15,0,0" Width="120" FontWeight="Bold" FontSize="20" Background="{x:Null}" IsReadOnly="False" Foreground="White"/>
  26. <PasswordBox x:Name="UserOldPassTbx" HorizontalAlignment="Left" Margin="0,15,0,0" VerticalAlignment="Top" Width="120" FontWeight="Bold" FontSize="20" Background="{x:Null}" Foreground="White" />
  27. <PasswordBox x:Name="UserNewPassTbx" HorizontalAlignment="Left" Margin="0,15,0,0" VerticalAlignment="Top" Width="120" FontWeight="Bold" FontSize="20" Background="{x:Null}" Foreground="White" />
  28. <PasswordBox x:Name="UserReNewPassTbx" HorizontalAlignment="Left" Margin="0,15,0,0" VerticalAlignment="Top" Width="120" FontWeight="Bold" FontSize="20" Background="{x:Null}" Foreground="White" />
  29. <ComboBox x:Name="UserLevelCbx" HorizontalAlignment="Left" Margin="0,12,0,0" VerticalAlignment="Top" Width="120" FontWeight="Bold" FontSize="20" Background="{x:Null}" IsReadOnly="True">
  30. <ComboBox.Template>
  31. <ControlTemplate TargetType="ComboBox">
  32. <Grid>
  33. <ToggleButton
  34. Foreground="White"
  35. IsChecked="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
  36. ClickMode="Press">
  37. <ToggleButton.Template>
  38. <ControlTemplate TargetType="ToggleButton">
  39. <Border x:Name="Border" Background="#FF2C3E50" BorderBrush="#FFABADB3" BorderThickness="1">
  40. <Grid>
  41. <Grid.ColumnDefinitions>
  42. <ColumnDefinition />
  43. <ColumnDefinition Width="20" />
  44. </Grid.ColumnDefinitions>
  45. <ContentPresenter Grid.Column="0" Margin="3" />
  46. <Path x:Name="Arrow" Grid.Column="1"
  47. Fill="White"
  48. HorizontalAlignment="Center"
  49. VerticalAlignment="Center"
  50. Data="M 0 0 L 4 4 L 8 0 Z" />
  51. </Grid>
  52. </Border>
  53. <ControlTemplate.Triggers>
  54. <Trigger Property="IsMouseOver" Value="True">
  55. <Setter TargetName="Border" Property="Background" Value="LightBlue" />
  56. </Trigger>
  57. </ControlTemplate.Triggers>
  58. </ControlTemplate>
  59. </ToggleButton.Template>
  60. </ToggleButton>
  61. <ContentPresenter x:Name="ContentSite"
  62. IsHitTestVisible="False"
  63. Content="{TemplateBinding SelectionBoxItem}"
  64. ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  65. Margin="3,3,23,3"
  66. VerticalAlignment="Center"
  67. HorizontalAlignment="Left"
  68. TextBlock.Foreground="White"/>
  69. <Popup x:Name="Popup"
  70. Placement="Bottom"
  71. IsOpen="{TemplateBinding IsDropDownOpen}"
  72. AllowsTransparency="True"
  73. Focusable="False"
  74. PopupAnimation="Slide">
  75. <Border x:Name="DropDownBorder"
  76. Background="#FF2C3E50"
  77. BorderBrush="#FF2C3E50"
  78. BorderThickness="1">
  79. <ScrollViewer Margin="0,3,0,3"
  80. SnapsToDevicePixels="True">
  81. <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
  82. </ScrollViewer>
  83. </Border>
  84. </Popup>
  85. </Grid>
  86. </ControlTemplate>
  87. </ComboBox.Template>
  88. <ComboBox.ItemContainerStyle>
  89. <Style TargetType="ComboBoxItem">
  90. <Setter Property="Background" Value="#FF2C3E50" />
  91. <Setter Property="Foreground" Value="White" />
  92. <Style.Triggers>
  93. <Trigger Property="IsHighlighted" Value="True">
  94. <Setter Property="Background" Value="LightBlue" />
  95. </Trigger>
  96. </Style.Triggers>
  97. </Style>
  98. </ComboBox.ItemContainerStyle>
  99. </ComboBox>
  100. </StackPanel>
  101. </StackPanel>
  102. <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,10">
  103. <Button x:Name="UserChangeBtn" Content="{DynamicResource Edit}" BorderThickness="1" HorizontalAlignment="Center" Margin="0,10,10,0" VerticalAlignment="Center" Width="80" Height="40" Background="#FF2980B9" FontWeight="Bold" FontSize="20" Foreground="White" Click="UserChangeBtn_Click" Cursor="Hand">
  104. <Button.Template>
  105. <ControlTemplate TargetType="Button">
  106. <Border CornerRadius="5"
  107. Background="{TemplateBinding Background}"
  108. BorderBrush="{TemplateBinding BorderBrush}"
  109. BorderThickness="{TemplateBinding BorderThickness}">
  110. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  111. </Border>
  112. </ControlTemplate>
  113. </Button.Template>
  114. </Button>
  115. <Button x:Name="UserResetPassBtn" Content="{DynamicResource PasswordReset}" BorderThickness="1" Margin="5,10,5,0" VerticalAlignment="Center" Height="40" Background="#FF2980B9" FontWeight="Bold" FontSize="20" Foreground="White" Click="UserResetPassBtn_Click" Cursor="Hand" Padding="1,1,1,1" Grid.IsSharedSizeScope="True" HorizontalAlignment="Center" MinWidth="120">
  116. <Button.Template>
  117. <ControlTemplate TargetType="Button">
  118. <Border CornerRadius="5"
  119. Background="{TemplateBinding Background}"
  120. BorderBrush="{TemplateBinding BorderBrush}"
  121. BorderThickness="{TemplateBinding BorderThickness}">
  122. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  123. </Border>
  124. </ControlTemplate>
  125. </Button.Template>
  126. </Button>
  127. <Button x:Name="UserCancelBtn" Content="{DynamicResource Cancel}" BorderThickness="1" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Center" Width="80" Height="40" Background="#FF2980B9" FontWeight="Bold" FontSize="20" Foreground="White" Click="UserCancelBtn_Click" Cursor="Hand">
  128. <Button.Template>
  129. <ControlTemplate TargetType="Button">
  130. <Border CornerRadius="5"
  131. Background="{TemplateBinding Background}"
  132. BorderBrush="{TemplateBinding BorderBrush}"
  133. BorderThickness="{TemplateBinding BorderThickness}">
  134. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  135. </Border>
  136. </ControlTemplate>
  137. </Button.Template>
  138. </Button>
  139. </StackPanel>
  140. </Grid>
  141. </Window>