AddUserWindow.xaml 9.7 KB

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