终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

504 lines
38 KiB

  1. <UserControl x:Class="BPASmartClient.CustomResource.Pages.View.UserManageView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
  7. xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
  8. xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <UserControl.DataContext>
  12. <vm:UserManageViewModel/>
  13. </UserControl.DataContext>
  14. <UserControl.Resources>
  15. <Style x:Key="dgCell" TargetType="TextBlock">
  16. <Setter Property="HorizontalAlignment" Value="Center"/>
  17. <Setter Property="VerticalAlignment" Value="Center"/>
  18. <Setter Property="Background" Value="Transparent"/>
  19. </Style>
  20. <Style x:Key="btnStyle" TargetType="Button">
  21. <Setter Property="Width" Value="auto"/>
  22. <Setter Property="FontSize" Value="16"/>
  23. <Setter Property="Foreground" Value="SkyBlue"/>
  24. <Setter Property="Background" Value="Transparent"/>
  25. <Setter Property="BorderBrush" Value="SkyBlue"/>
  26. </Style>
  27. <Style x:Key="textboxStyle" TargetType="TextBox">
  28. <Setter Property="Background" Value="Transparent"/>
  29. <Setter Property="Foreground" Value="SkyBlue"/>
  30. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  31. <Setter Property="VerticalContentAlignment" Value="Center"/>
  32. <Setter Property="FontSize" Value="16"/>
  33. <Setter Property="BorderThickness" Value="0"/>
  34. <Setter Property="CaretBrush" Value="LightBlue"/>
  35. <Style.Triggers>
  36. <Trigger Property="IsFocused" Value="True">
  37. <Setter Property="Cursor" Value="Arrow"/>
  38. </Trigger>
  39. </Style.Triggers>
  40. </Style>
  41. <Style TargetType="DataGrid" x:Key="dataGrid">
  42. <!--网格线颜色-->
  43. <Setter Property="CanUserResizeColumns" Value="false"/>
  44. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"></Setter>
  45. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"></Setter>
  46. <Setter Property="HeadersVisibility" Value="Column"/>
  47. <Setter Property="HorizontalGridLinesBrush">
  48. <Setter.Value>
  49. <SolidColorBrush Color="#FF2AB2E7"/>
  50. </Setter.Value>
  51. </Setter>
  52. <Setter Property="VerticalGridLinesBrush">
  53. <Setter.Value>
  54. <SolidColorBrush Color="#FF2AB2E7"/>
  55. </Setter.Value>
  56. </Setter>
  57. </Style>
  58. <Style x:Key="columsHeader" TargetType="DataGridColumnHeader">
  59. <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
  60. <Setter Property="VerticalAlignment" Value="Center"/>
  61. <Setter Property="Foreground" Value="White"></Setter>
  62. <Setter Property="Background" Value="#FF2AB2E7"/>
  63. <Setter Property="BorderThickness" Value="1"></Setter>
  64. <Setter Property="BorderBrush" Value="white"></Setter>
  65. <Setter Property="Height" Value="30"/>
  66. <Setter Property="FontSize" Value="16"/>
  67. <Setter Property="FontWeight" Value="Heavy"/>
  68. <Setter Property="Margin" Value="-1,-1,-1,-1"/>
  69. </Style>
  70. <Style x:Key="rowStyle" TargetType="DataGridRow">
  71. <Setter Property="Height" Value="35"/>
  72. <Setter Property="Foreground" Value="SkyBlue"/>
  73. <Style.Triggers>
  74. <Trigger Property="AlternationIndex" Value="0">
  75. <Setter Property="Background" Value="Transparent" />
  76. </Trigger>
  77. <Trigger Property="AlternationIndex" Value="1">
  78. <Setter Property="Background" Value="Transparent" />
  79. </Trigger>
  80. <Trigger Property="IsMouseOver" Value="True">
  81. <Setter Property="Background" Value="#000066" />
  82. </Trigger>
  83. </Style.Triggers>
  84. </Style>
  85. <Style x:Key="cellStyle" TargetType="DataGridCell">
  86. <Style.Triggers>
  87. <Trigger Property="IsSelected" Value="True">
  88. <Setter Property="Background" Value="Transparent"/>
  89. <Setter Property="Foreground"
  90. Value="SkyBlue"/>
  91. </Trigger>
  92. <Trigger Property="IsSelected" Value="false">
  93. <Setter Property="Background" Value="Transparent"/>
  94. <Setter Property="Foreground"
  95. Value="SkyBlue"/>
  96. </Trigger>
  97. </Style.Triggers>
  98. </Style>
  99. <LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
  100. <GradientStop Color="Transparent" Offset="0.0"/>
  101. <GradientStop Color="Transparent" Offset="1.0"/>
  102. </LinearGradientBrush>
  103. <SolidColorBrush x:Key="ComboBox.Static.Border" Color="SkyBlue"/>
  104. <SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="SkyBlue"/>
  105. <SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="LightBlue"/>
  106. <SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#FFABADB3"/>
  107. <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
  108. <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent"/>
  109. <LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
  110. <GradientStop Color="SteelBlue" Offset="0.0"/>
  111. <GradientStop Color="SteelBlue" Offset="1.0"/>
  112. </LinearGradientBrush>
  113. <SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF7EB4EA"/>
  114. <SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
  115. <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#FFFFFFFF"/>
  116. <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Border" Color="#FF7EB4EA"/>
  117. <LinearGradientBrush x:Key="ComboBox.MouseOver.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
  118. <GradientStop Color="#FFEBF4FC" Offset="0.0"/>
  119. <GradientStop Color="#FFDCECFC" Offset="1.0"/>
  120. </LinearGradientBrush>
  121. <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#FF7EB4EA"/>
  122. <LinearGradientBrush x:Key="ComboBox.Pressed.Background" EndPoint="0,1" StartPoint="0,0">
  123. <GradientStop Color="#FFDAECFC" Offset="0.0"/>
  124. <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
  125. </LinearGradientBrush>
  126. <SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="#FF569DE5"/>
  127. <SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
  128. <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
  129. <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
  130. <LinearGradientBrush x:Key="ComboBox.Pressed.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
  131. <GradientStop Color="#FFDAEBFC" Offset="0.0"/>
  132. <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
  133. </LinearGradientBrush>
  134. <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Border" Color="#FF569DE5"/>
  135. <SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="#FFF0F0F0"/>
  136. <SolidColorBrush x:Key="ComboBox.Disabled.Border" Color="#FFD9D9D9"/>
  137. <SolidColorBrush x:Key="ComboBox.Disabled.Glyph" Color="#FFBFBFBF"/>
  138. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Background" Color="#FFFFFFFF"/>
  139. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Border" Color="#FFBFBFBF"/>
  140. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Background" Color="Transparent"/>
  141. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Border" Color="Transparent"/>
  142. <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
  143. <Setter Property="OverridesDefaultStyle" Value="true"/>
  144. <Setter Property="IsTabStop" Value="false"/>
  145. <Setter Property="Focusable" Value="false"/>
  146. <Setter Property="ClickMode" Value="Press"/>
  147. <Setter Property="Template">
  148. <Setter.Value>
  149. <ControlTemplate TargetType="{x:Type ToggleButton}">
  150. <Border x:Name="templateRoot" Background="{StaticResource ComboBox.Static.Background}" BorderBrush="{StaticResource ComboBox.Static.Border}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  151. <Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Margin="0" SnapsToDevicePixels="true" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
  152. <Path x:Name="arrow" Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z" Fill="{StaticResource ComboBox.Static.Glyph}" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center"/>
  153. </Border>
  154. </Border>
  155. <ControlTemplate.Triggers>
  156. <MultiDataTrigger>
  157. <MultiDataTrigger.Conditions>
  158. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  159. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false"/>
  160. <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false"/>
  161. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true"/>
  162. </MultiDataTrigger.Conditions>
  163. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Background}"/>
  164. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Border}"/>
  165. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Background}"/>
  166. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Border}"/>
  167. </MultiDataTrigger>
  168. <Trigger Property="IsMouseOver" Value="true">
  169. <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.MouseOver.Glyph}"/>
  170. </Trigger>
  171. <MultiDataTrigger>
  172. <MultiDataTrigger.Conditions>
  173. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  174. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  175. </MultiDataTrigger.Conditions>
  176. <!--<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Background}"/>-->
  177. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Border}"/>
  178. </MultiDataTrigger>
  179. <MultiDataTrigger>
  180. <MultiDataTrigger.Conditions>
  181. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  182. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  183. </MultiDataTrigger.Conditions>
  184. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Background}"/>
  185. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Border}"/>
  186. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Background}"/>
  187. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Border}"/>
  188. </MultiDataTrigger>
  189. <Trigger Property="IsPressed" Value="true">
  190. <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Pressed.Glyph}"/>
  191. </Trigger>
  192. <MultiDataTrigger>
  193. <MultiDataTrigger.Conditions>
  194. <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
  195. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  196. </MultiDataTrigger.Conditions>
  197. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Background}"/>
  198. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Border}"/>
  199. </MultiDataTrigger>
  200. <MultiDataTrigger>
  201. <MultiDataTrigger.Conditions>
  202. <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
  203. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  204. </MultiDataTrigger.Conditions>
  205. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Background}"/>
  206. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Border}"/>
  207. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Background}"/>
  208. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Border}"/>
  209. </MultiDataTrigger>
  210. <Trigger Property="IsEnabled" Value="false">
  211. <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Disabled.Glyph}"/>
  212. </Trigger>
  213. <MultiDataTrigger>
  214. <MultiDataTrigger.Conditions>
  215. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  216. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  217. </MultiDataTrigger.Conditions>
  218. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Background}"/>
  219. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Border}"/>
  220. </MultiDataTrigger>
  221. <MultiDataTrigger>
  222. <MultiDataTrigger.Conditions>
  223. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  224. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  225. </MultiDataTrigger.Conditions>
  226. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Background}"/>
  227. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Border}"/>
  228. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Background}"/>
  229. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Border}"/>
  230. </MultiDataTrigger>
  231. </ControlTemplate.Triggers>
  232. </ControlTemplate>
  233. </Setter.Value>
  234. </Setter>
  235. </Style>
  236. <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
  237. <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  238. <Grid.ColumnDefinitions>
  239. <ColumnDefinition Width="*"/>
  240. <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
  241. </Grid.ColumnDefinitions>
  242. <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  243. <theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
  244. <Border x:Name="dropDownBorder" Background="White" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
  245. <ScrollViewer x:Name="DropDownScrollViewer">
  246. <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
  247. <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
  248. <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
  249. </Canvas>
  250. <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  251. </Grid>
  252. </ScrollViewer>
  253. </Border>
  254. </theme:SystemDropShadowChrome>
  255. </Popup>
  256. <ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
  257. <ContentPresenter x:Name="contentPresenter" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  258. </Grid>
  259. <ControlTemplate.Triggers>
  260. <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
  261. <Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
  262. <Setter Property="Color" TargetName="shadow" Value="#71000000"/>
  263. </Trigger>
  264. <Trigger Property="HasItems" Value="false">
  265. <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
  266. </Trigger>
  267. <MultiTrigger>
  268. <MultiTrigger.Conditions>
  269. <Condition Property="IsGrouping" Value="true"/>
  270. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
  271. </MultiTrigger.Conditions>
  272. <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
  273. </MultiTrigger>
  274. <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
  275. <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
  276. <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
  277. </Trigger>
  278. </ControlTemplate.Triggers>
  279. </ControlTemplate>
  280. <LinearGradientBrush x:Key="Button.Static.Background" EndPoint="0,1" StartPoint="0,0">
  281. <GradientStop Color="Transparent" Offset="0.0"/>
  282. <GradientStop Color="Transparent" Offset="1.0"/>
  283. </LinearGradientBrush>
  284. <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
  285. <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
  286. <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
  287. <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
  288. <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
  289. <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
  290. <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
  291. <ControlTemplate x:Key="ButtonTemplate1" TargetType="{x:Type ButtonBase}">
  292. <Border x:Name="border" Background="{StaticResource Button.Static.Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  293. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  294. </Border>
  295. <ControlTemplate.Triggers>
  296. <Trigger Property="Button.IsDefaulted" Value="true">
  297. <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  298. </Trigger>
  299. <Trigger Property="IsMouseOver" Value="true">
  300. <!--<Setter Property="Background" TargetName="border" Value="#000066"/>-->
  301. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
  302. </Trigger>
  303. <Trigger Property="IsPressed" Value="true">
  304. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
  305. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
  306. </Trigger>
  307. <Trigger Property="IsEnabled" Value="false">
  308. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
  309. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
  310. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
  311. </Trigger>
  312. </ControlTemplate.Triggers>
  313. </ControlTemplate>
  314. <Style x:Key="FocusVisual">
  315. <Setter Property="Control.Template">
  316. <Setter.Value>
  317. <ControlTemplate>
  318. <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
  319. </ControlTemplate>
  320. </Setter.Value>
  321. </Setter>
  322. </Style>
  323. <SolidColorBrush x:Key="Button.Static.Background1" Color="#FFDDDDDD"/>
  324. <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
  325. <SolidColorBrush x:Key="Button.MouseOver.Background1" Color="#FF2AB2E7"/>
  326. <SolidColorBrush x:Key="Button.MouseOver.Border1" Color="#FF3C7FB1"/>
  327. <SolidColorBrush x:Key="Button.Pressed.Background1" Color="#FFC4E5F6"/>
  328. <SolidColorBrush x:Key="Button.Pressed.Border1" Color="#FF2C628B"/>
  329. <SolidColorBrush x:Key="Button.Disabled.Background1" Color="#FFF4F4F4"/>
  330. <SolidColorBrush x:Key="Button.Disabled.Border1" Color="#FFADB2B5"/>
  331. <SolidColorBrush x:Key="Button.Disabled.Foreground1" Color="#FF838383"/>
  332. <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
  333. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
  334. <Setter Property="Background" Value="{StaticResource Button.Static.Background1}"/>
  335. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
  336. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  337. <Setter Property="BorderThickness" Value="1"/>
  338. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  339. <Setter Property="VerticalContentAlignment" Value="Center"/>
  340. <Setter Property="Padding" Value="1"/>
  341. <Setter Property="Template">
  342. <Setter.Value>
  343. <ControlTemplate TargetType="{x:Type Button}">
  344. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  345. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  346. </Border>
  347. <ControlTemplate.Triggers>
  348. <Trigger Property="IsDefaulted" Value="true">
  349. <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  350. </Trigger>
  351. <Trigger Property="IsMouseOver" Value="true">
  352. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background1}"/>
  353. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border1}"/>
  354. </Trigger>
  355. <Trigger Property="IsPressed" Value="true">
  356. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background1}"/>
  357. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border1}"/>
  358. </Trigger>
  359. <Trigger Property="IsEnabled" Value="false">
  360. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background1}"/>
  361. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border1}"/>
  362. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground1}"/>
  363. </Trigger>
  364. </ControlTemplate.Triggers>
  365. </ControlTemplate>
  366. </Setter.Value>
  367. </Setter>
  368. </Style>
  369. </UserControl.Resources>
  370. <Grid>
  371. <Grid.RowDefinitions>
  372. <RowDefinition Height="40"/>
  373. <RowDefinition/>
  374. </Grid.RowDefinitions>
  375. <StackPanel x:Name="btn" Orientation="Horizontal" HorizontalAlignment="Right">
  376. <!--<Button HorizontalAlignment="Right" Width="100" Height="30" Content="保存数据" BorderThickness="1" BorderBrush="Cyan" Background="Transparent" Foreground="Aqua" FontSize="16" Command="{Binding SaveDataCommand}" Margin="0,0,10,0"></Button>-->
  377. <Button Style="{DynamicResource ButtonStyle1}" Width="105" Height="30" Background="Transparent" Foreground="Aqua" Command="{Binding AddUserInfoCommand}" Margin="0,0,10,0">
  378. <Button.Content>
  379. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  380. <TextBlock x:Name="t1" Width="auto" Height="auto" FontFamily="../../Fonts/font/#iconfont" Text="&#xe602;" VerticalAlignment="Center" FontSize="18" Margin="0,0,6,0"/>
  381. <TextBlock x:Name="t2" Width="auto" Height="auto" Text="添加账号" FontSize="17" VerticalAlignment="Center"/>
  382. </StackPanel>
  383. </Button.Content>
  384. </Button>
  385. </StackPanel>
  386. <ScrollViewer VerticalScrollBarVisibility="Hidden" Grid.Row="1">
  387. <DataGrid ItemsSource="{Binding usersInfo}" GridLinesVisibility="All" Background="Transparent"
  388. AutoGenerateColumns="False"
  389. CanUserAddRows="False"
  390. IsReadOnly="False" Style="{StaticResource dataGrid }"
  391. ColumnHeaderStyle="{StaticResource columsHeader}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
  392. <DataGrid.Columns>
  393. <!--<DataGridTemplateColumn Width="0.2*">
  394. <DataGridTemplateColumn.Header>
  395. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
  396. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe6a0;" FontSize="24" VerticalAlignment="Center" Margin="0,0,8,0"/>
  397. <TextBlock Text="Account" />
  398. </StackPanel>
  399. </DataGridTemplateColumn.Header>
  400. <DataGridTemplateColumn.CellTemplate>
  401. <DataTemplate>
  402. <TextBox Text="{Binding UserName}" Style="{StaticResource textboxStyle}"></TextBox>
  403. </DataTemplate>
  404. </DataGridTemplateColumn.CellTemplate>
  405. </DataGridTemplateColumn>-->
  406. <DataGridTextColumn FontSize="16" IsReadOnly="false" Width="0.2*" Binding="{Binding UserName}" ElementStyle="{StaticResource dgCell}">
  407. <DataGridTextColumn.Header>
  408. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  409. <TextBlock FontFamily="../../Fonts/font/#iconfont" Foreground="Orange" Text="&#xe6a0;" FontSize="20" VerticalAlignment="Center" Margin="0,0,8,0"/>
  410. <TextBlock Text="Account" />
  411. </StackPanel>
  412. </DataGridTextColumn.Header>
  413. </DataGridTextColumn>
  414. <!--<DataGridTemplateColumn Width="0.2*">
  415. <DataGridTemplateColumn.Header>
  416. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
  417. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe62b;" FontSize="24" VerticalAlignment="Center" Margin="0,0,8,0"/>
  418. <TextBlock Text="Account" />
  419. </StackPanel>
  420. </DataGridTemplateColumn.Header>
  421. <DataGridTemplateColumn.CellTemplate>
  422. <DataTemplate>
  423. <TextBox Text="{Binding Password}" Style="{StaticResource textboxStyle}"></TextBox>
  424. </DataTemplate>
  425. </DataGridTemplateColumn.CellTemplate>
  426. </DataGridTemplateColumn>-->
  427. <DataGridTextColumn FontSize="16" IsReadOnly="False" Width="0.2*" Binding="{Binding Password}" ElementStyle="{StaticResource dgCell}" >
  428. <DataGridTextColumn.Header>
  429. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  430. <TextBlock FontFamily="../../Fonts/font/#iconfont" Foreground="Orange" Text="&#xe62b;" VerticalAlignment="Center" Margin="0,0,8,0"/>
  431. <TextBlock Text="Password"/>
  432. </StackPanel>
  433. </DataGridTextColumn.Header>
  434. </DataGridTextColumn>
  435. <DataGridTextColumn FontSize="16" IsReadOnly="True" Width="0.2*" Binding="{Binding CardId}" ElementStyle="{StaticResource dgCell}">
  436. <DataGridTextColumn.Header>
  437. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  438. <TextBlock FontFamily="../../Fonts/font/#iconfont" Foreground="Orange" Text="&#xe8e0;" VerticalAlignment="Center" Margin="0,0,8,0"/>
  439. <TextBlock Text="NFC"/>
  440. </StackPanel>
  441. </DataGridTextColumn.Header>
  442. </DataGridTextColumn>
  443. <DataGridTemplateColumn Width="0.2*">
  444. <DataGridTemplateColumn.Header>
  445. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  446. <TextBlock FontFamily="../../Fonts/font/#iconfont" Foreground="Orange" Text="&#xe62c;" VerticalAlignment="Center" Margin="0,0,8,0"/>
  447. <TextBlock Text="Authority"/>
  448. </StackPanel>
  449. </DataGridTemplateColumn.Header>
  450. <DataGridTemplateColumn.CellTemplate>
  451. <DataTemplate>
  452. <ComboBox Text="{Binding permission}" Template="{DynamicResource ComboBoxTemplate}" SelectedItem="{Binding permission}" Tag="{Binding Id}" ItemsSource="{Binding DataContext.Authorities, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}, Mode=FindAncestor}}" SelectionChanged="ComboBox_SelectionChanged" IsEditable="False" Foreground="SkyBlue" VerticalContentAlignment="Center" Width="auto" FontSize="16" HorizontalContentAlignment="Center" >
  453. <ComboBox.ItemContainerStyle>
  454. <Style TargetType="{x:Type ComboBoxItem}">
  455. <Setter Property="FontSize" Value="16"/>
  456. <Setter Property="Background" Value="White" />
  457. <Setter Property="Foreground" Value="#FF2AB2E7"/>
  458. </Style>
  459. </ComboBox.ItemContainerStyle>
  460. </ComboBox>
  461. </DataTemplate>
  462. </DataGridTemplateColumn.CellTemplate>
  463. </DataGridTemplateColumn>
  464. <DataGridTemplateColumn Width="0.4*">
  465. <DataGridTemplateColumn.Header>
  466. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  467. <TextBlock FontFamily="../../Fonts/font/#iconfont" Foreground="Orange" Text="&#xe979;" VerticalAlignment="Center" Margin="0,0,8,0"/>
  468. <TextBlock Text="Operate"/>
  469. </StackPanel>
  470. </DataGridTemplateColumn.Header>
  471. <DataGridTemplateColumn.CellTemplate>
  472. <DataTemplate>
  473. <Grid>
  474. <Grid.ColumnDefinitions>
  475. <ColumnDefinition/>
  476. <ColumnDefinition/>
  477. <!--<ColumnDefinition/>-->
  478. </Grid.ColumnDefinitions>
  479. <Button Command="{Binding DataContext.SaveCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
  480. CommandParameter="{Binding UserName}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Foreground="Cyan" Content="Save" Margin="5,0"></Button>
  481. <!--<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Update" Grid.Column="1" Margin="5,0"></Button>-->
  482. <Button Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Delete" Grid.Column="1" Foreground="Cyan" Margin="5,0" ></Button>
  483. </Grid>
  484. </DataTemplate>
  485. </DataGridTemplateColumn.CellTemplate>
  486. </DataGridTemplateColumn>
  487. </DataGrid.Columns>
  488. </DataGrid>
  489. </ScrollViewer>
  490. </Grid>
  491. </UserControl>