终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserManageView.xaml 32 KiB

2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <UserControl x:Class="FryPot_DosingSystem.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:FryPot_DosingSystem.View"
  7. xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800"
  10. xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2">
  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="Auto"></Setter>
  45. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"></Setter>
  46. <Setter Property="HeadersVisibility" Value="Column"/>
  47. <Setter Property="HorizontalGridLinesBrush">
  48. <Setter.Value>
  49. <SolidColorBrush Color="#03ffea"/>
  50. </Setter.Value>
  51. </Setter>
  52. <Setter Property="VerticalGridLinesBrush">
  53. <Setter.Value>
  54. <SolidColorBrush Color="#03ffea"/>
  55. </Setter.Value>
  56. </Setter>
  57. </Style>
  58. <Style x:Key="columsHeader" TargetType="DataGridColumnHeader">
  59. <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
  60. <Setter Property="Background" Value="Transparent"></Setter>
  61. <Setter Property="Foreground" Value="#17acae"></Setter>
  62. <Setter Property="BorderThickness" Value="1"></Setter>
  63. <Setter Property="BorderBrush" Value="#03ffea"></Setter>
  64. <Setter Property="Height" Value="45"/>
  65. <Setter Property="FontSize" Value="22"/>
  66. <Setter Property="FontWeight" Value="Heavy"/>
  67. </Style>
  68. <Style x:Key="rowStyle" TargetType="DataGridRow">
  69. <Setter Property="Height" Value="35"/>
  70. <Setter Property="Foreground" Value="SkyBlue"/>
  71. <Style.Triggers>
  72. <Trigger Property="AlternationIndex" Value="0">
  73. <Setter Property="Background" Value="Transparent" />
  74. </Trigger>
  75. <Trigger Property="AlternationIndex" Value="1">
  76. <Setter Property="Background" Value="Transparent" />
  77. </Trigger>
  78. <Trigger Property="IsMouseOver" Value="True">
  79. <Setter Property="Background" Value="#000066" />
  80. </Trigger>
  81. </Style.Triggers>
  82. </Style>
  83. <Style x:Key="cellStyle" TargetType="DataGridCell">
  84. <Style.Triggers>
  85. <Trigger Property="IsSelected" Value="True">
  86. <Setter Property="Background" Value="Transparent"/>
  87. <Setter Property="Foreground"
  88. Value="SkyBlue"/>
  89. </Trigger>
  90. <Trigger Property="IsSelected" Value="false">
  91. <Setter Property="Background" Value="Transparent"/>
  92. <Setter Property="Foreground"
  93. Value="SkyBlue"/>
  94. </Trigger>
  95. </Style.Triggers>
  96. </Style>
  97. <LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
  98. <GradientStop Color="#8080ff" Offset="0.0"/>
  99. <GradientStop Color="#000066" Offset="1.0"/>
  100. </LinearGradientBrush>
  101. <SolidColorBrush x:Key="ComboBox.Static.Border" Color="SkyBlue"/>
  102. <SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="SkyBlue"/>
  103. <SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="LightBlue"/>
  104. <SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#FFABADB3"/>
  105. <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
  106. <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent"/>
  107. <LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
  108. <GradientStop Color="SteelBlue" Offset="0.0"/>
  109. <GradientStop Color="SteelBlue" Offset="1.0"/>
  110. </LinearGradientBrush>
  111. <SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF7EB4EA"/>
  112. <SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
  113. <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#FFFFFFFF"/>
  114. <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Border" Color="#FF7EB4EA"/>
  115. <LinearGradientBrush x:Key="ComboBox.MouseOver.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
  116. <GradientStop Color="#FFEBF4FC" Offset="0.0"/>
  117. <GradientStop Color="#FFDCECFC" Offset="1.0"/>
  118. </LinearGradientBrush>
  119. <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#FF7EB4EA"/>
  120. <LinearGradientBrush x:Key="ComboBox.Pressed.Background" EndPoint="0,1" StartPoint="0,0">
  121. <GradientStop Color="#FFDAECFC" Offset="0.0"/>
  122. <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
  123. </LinearGradientBrush>
  124. <SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="#FF569DE5"/>
  125. <SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
  126. <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
  127. <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
  128. <LinearGradientBrush x:Key="ComboBox.Pressed.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
  129. <GradientStop Color="#FFDAEBFC" Offset="0.0"/>
  130. <GradientStop Color="#FFC4E0FC" Offset="1.0"/>
  131. </LinearGradientBrush>
  132. <SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Border" Color="#FF569DE5"/>
  133. <SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="#FFF0F0F0"/>
  134. <SolidColorBrush x:Key="ComboBox.Disabled.Border" Color="#FFD9D9D9"/>
  135. <SolidColorBrush x:Key="ComboBox.Disabled.Glyph" Color="#FFBFBFBF"/>
  136. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Background" Color="#FFFFFFFF"/>
  137. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Border" Color="#FFBFBFBF"/>
  138. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Background" Color="Transparent"/>
  139. <SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Border" Color="Transparent"/>
  140. <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
  141. <Setter Property="OverridesDefaultStyle" Value="true"/>
  142. <Setter Property="IsTabStop" Value="false"/>
  143. <Setter Property="Focusable" Value="false"/>
  144. <Setter Property="ClickMode" Value="Press"/>
  145. <Setter Property="Template">
  146. <Setter.Value>
  147. <ControlTemplate TargetType="{x:Type ToggleButton}">
  148. <Border x:Name="templateRoot" Background="{StaticResource ComboBox.Static.Background}" BorderBrush="{StaticResource ComboBox.Static.Border}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  149. <Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Margin="0" SnapsToDevicePixels="true" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
  150. <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"/>
  151. </Border>
  152. </Border>
  153. <ControlTemplate.Triggers>
  154. <MultiDataTrigger>
  155. <MultiDataTrigger.Conditions>
  156. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  157. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false"/>
  158. <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false"/>
  159. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true"/>
  160. </MultiDataTrigger.Conditions>
  161. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Background}"/>
  162. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Static.Editable.Border}"/>
  163. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Background}"/>
  164. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Static.Editable.Button.Border}"/>
  165. </MultiDataTrigger>
  166. <Trigger Property="IsMouseOver" Value="true">
  167. <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.MouseOver.Glyph}"/>
  168. </Trigger>
  169. <MultiDataTrigger>
  170. <MultiDataTrigger.Conditions>
  171. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  172. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  173. </MultiDataTrigger.Conditions>
  174. <!--<Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Background}"/>-->
  175. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Border}"/>
  176. </MultiDataTrigger>
  177. <MultiDataTrigger>
  178. <MultiDataTrigger.Conditions>
  179. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  180. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  181. </MultiDataTrigger.Conditions>
  182. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Background}"/>
  183. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Border}"/>
  184. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Background}"/>
  185. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Border}"/>
  186. </MultiDataTrigger>
  187. <Trigger Property="IsPressed" Value="true">
  188. <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Pressed.Glyph}"/>
  189. </Trigger>
  190. <MultiDataTrigger>
  191. <MultiDataTrigger.Conditions>
  192. <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
  193. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  194. </MultiDataTrigger.Conditions>
  195. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Background}"/>
  196. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Border}"/>
  197. </MultiDataTrigger>
  198. <MultiDataTrigger>
  199. <MultiDataTrigger.Conditions>
  200. <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="true"/>
  201. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  202. </MultiDataTrigger.Conditions>
  203. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Background}"/>
  204. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Pressed.Editable.Border}"/>
  205. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Background}"/>
  206. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Pressed.Editable.Button.Border}"/>
  207. </MultiDataTrigger>
  208. <Trigger Property="IsEnabled" Value="false">
  209. <Setter Property="Fill" TargetName="arrow" Value="{StaticResource ComboBox.Disabled.Glyph}"/>
  210. </Trigger>
  211. <MultiDataTrigger>
  212. <MultiDataTrigger.Conditions>
  213. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  214. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
  215. </MultiDataTrigger.Conditions>
  216. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Background}"/>
  217. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Border}"/>
  218. </MultiDataTrigger>
  219. <MultiDataTrigger>
  220. <MultiDataTrigger.Conditions>
  221. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  222. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
  223. </MultiDataTrigger.Conditions>
  224. <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Background}"/>
  225. <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.Disabled.Editable.Border}"/>
  226. <Setter Property="Background" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Background}"/>
  227. <Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.Disabled.Editable.Button.Border}"/>
  228. </MultiDataTrigger>
  229. </ControlTemplate.Triggers>
  230. </ControlTemplate>
  231. </Setter.Value>
  232. </Setter>
  233. </Style>
  234. <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
  235. <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  236. <Grid.ColumnDefinitions>
  237. <ColumnDefinition Width="*"/>
  238. <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
  239. </Grid.ColumnDefinitions>
  240. <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}}">
  241. <theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
  242. <Border x:Name="dropDownBorder" Background="SkyBlue" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
  243. <ScrollViewer x:Name="DropDownScrollViewer">
  244. <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
  245. <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
  246. <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
  247. </Canvas>
  248. <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  249. </Grid>
  250. </ScrollViewer>
  251. </Border>
  252. </theme:SystemDropShadowChrome>
  253. </Popup>
  254. <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}"/>
  255. <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}"/>
  256. </Grid>
  257. <ControlTemplate.Triggers>
  258. <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
  259. <Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
  260. <Setter Property="Color" TargetName="shadow" Value="#71000000"/>
  261. </Trigger>
  262. <Trigger Property="HasItems" Value="false">
  263. <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
  264. </Trigger>
  265. <MultiTrigger>
  266. <MultiTrigger.Conditions>
  267. <Condition Property="IsGrouping" Value="true"/>
  268. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
  269. </MultiTrigger.Conditions>
  270. <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
  271. </MultiTrigger>
  272. <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
  273. <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
  274. <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
  275. </Trigger>
  276. </ControlTemplate.Triggers>
  277. </ControlTemplate>
  278. <LinearGradientBrush x:Key="Button.Static.Background" EndPoint="0,1" StartPoint="0,0">
  279. <GradientStop Color="#8080ff" Offset="0.0"/>
  280. <GradientStop Color="#000066" Offset="1.0"/>
  281. </LinearGradientBrush>
  282. <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
  283. <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
  284. <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
  285. <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
  286. <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
  287. <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
  288. <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
  289. <ControlTemplate x:Key="ButtonTemplate1" TargetType="{x:Type ButtonBase}">
  290. <Border x:Name="border" Background="{StaticResource Button.Static.Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  291. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  292. </Border>
  293. <ControlTemplate.Triggers>
  294. <Trigger Property="Button.IsDefaulted" Value="true">
  295. <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  296. </Trigger>
  297. <Trigger Property="IsMouseOver" Value="true">
  298. <!--<Setter Property="Background" TargetName="border" Value="#000066"/>-->
  299. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
  300. </Trigger>
  301. <Trigger Property="IsPressed" Value="true">
  302. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
  303. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
  304. </Trigger>
  305. <Trigger Property="IsEnabled" Value="false">
  306. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
  307. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
  308. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
  309. </Trigger>
  310. </ControlTemplate.Triggers>
  311. </ControlTemplate>
  312. </UserControl.Resources>
  313. <Grid>
  314. <ScrollViewer VerticalScrollBarVisibility="Hidden">
  315. <DataGrid Name="dataGrid" ItemsSource="{Binding usersInfo}" GridLinesVisibility="All" Background="Transparent"
  316. AutoGenerateColumns="False"
  317. IsReadOnly="False" Style="{StaticResource dataGrid }"
  318. ColumnHeaderStyle="{StaticResource columsHeader}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}">
  319. <DataGrid.Columns>
  320. <DataGridTemplateColumn Width="0.2*">
  321. <DataGridTemplateColumn.Header>
  322. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
  323. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe6a0;" FontSize="24" VerticalAlignment="Center" Margin="0,0,8,0"/>
  324. <TextBlock Text="Account" />
  325. </StackPanel>
  326. </DataGridTemplateColumn.Header>
  327. <DataGridTemplateColumn.CellTemplate>
  328. <DataTemplate>
  329. <TextBox Text="{Binding UserName}" Style="{StaticResource textboxStyle}"></TextBox>
  330. </DataTemplate>
  331. </DataGridTemplateColumn.CellTemplate>
  332. </DataGridTemplateColumn>
  333. <!--<DataGridTextColumn FontSize="16" IsReadOnly="false" Width="0.2*" Binding="{Binding UserName}" ElementStyle="{StaticResource dgCell}">
  334. <DataGridTextColumn.Header>
  335. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  336. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe6a0;" FontSize="24" VerticalAlignment="Center" Margin="0,0,8,0"/>
  337. <TextBlock Text="Account" />
  338. </StackPanel>
  339. </DataGridTextColumn.Header>
  340. </DataGridTextColumn>-->
  341. <DataGridTemplateColumn Width="0.2*">
  342. <DataGridTemplateColumn.Header>
  343. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
  344. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe62b;" FontSize="24" VerticalAlignment="Center" Margin="0,0,8,0"/>
  345. <TextBlock Text="Account" />
  346. </StackPanel>
  347. </DataGridTemplateColumn.Header>
  348. <DataGridTemplateColumn.CellTemplate>
  349. <DataTemplate>
  350. <TextBox Text="{Binding Password}" Style="{StaticResource textboxStyle}"></TextBox>
  351. </DataTemplate>
  352. </DataGridTemplateColumn.CellTemplate>
  353. </DataGridTemplateColumn>
  354. <!--<DataGridTextColumn FontSize="16" IsReadOnly="False" Width="0.2*" Binding="{Binding Password}" ElementStyle="{StaticResource dgCell}" >
  355. <DataGridTextColumn.Header>
  356. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  357. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe62b;" VerticalAlignment="Center" Margin="0,0,8,0"/>
  358. <TextBlock Text="Password"/>
  359. </StackPanel>
  360. </DataGridTextColumn.Header>
  361. </DataGridTextColumn>-->
  362. <DataGridTemplateColumn Width="0.2*">
  363. <DataGridTemplateColumn.Header>
  364. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  365. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe62c;" VerticalAlignment="Center" Margin="0,0,8,0"/>
  366. <TextBlock Text="Authority"/>
  367. </StackPanel>
  368. </DataGridTemplateColumn.Header>
  369. <DataGridTemplateColumn.CellTemplate>
  370. <DataTemplate>
  371. <ComboBox Text="{Binding permission}" Template="{DynamicResource ComboBoxTemplate}" ItemsSource="{Binding DataContext.Authorities, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}, Mode=FindAncestor}}" IsEditable="False" Foreground="SkyBlue" VerticalContentAlignment="Center" Width="auto" FontSize="16" HorizontalContentAlignment="Center" >
  372. <ComboBox.ItemContainerStyle>
  373. <Style TargetType="{x:Type ComboBoxItem}">
  374. <Setter Property="FontSize" Value="16"/>
  375. <Setter Property="Background" Value="SkyBlue" />
  376. <Setter Property="Foreground" Value="Aqua"/>
  377. </Style>
  378. </ComboBox.ItemContainerStyle>
  379. </ComboBox>
  380. </DataTemplate>
  381. </DataGridTemplateColumn.CellTemplate>
  382. </DataGridTemplateColumn>
  383. <DataGridTemplateColumn Width="0.4*">
  384. <DataGridTemplateColumn.Header>
  385. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  386. <TextBlock FontFamily="../Resources/fonts/#iconfont" Foreground="Orange" Text="&#xe979;" VerticalAlignment="Center" Margin="0,0,8,0"/>
  387. <TextBlock Text="Operate"/>
  388. </StackPanel>
  389. </DataGridTemplateColumn.Header>
  390. <DataGridTemplateColumn.CellTemplate>
  391. <DataTemplate>
  392. <Grid>
  393. <Grid.ColumnDefinitions>
  394. <ColumnDefinition/>
  395. <ColumnDefinition/>
  396. <!--<ColumnDefinition/>-->
  397. </Grid.ColumnDefinitions>
  398. <Button Command="{Binding DataContext.SaveCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
  399. CommandParameter="{Binding Account}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Save" Margin="5,0"></Button>
  400. <!--<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>-->
  401. <Button Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding Account}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Delete" Grid.Column="1" Margin="5,0"></Button>
  402. </Grid>
  403. </DataTemplate>
  404. </DataGridTemplateColumn.CellTemplate>
  405. </DataGridTemplateColumn>
  406. </DataGrid.Columns>
  407. </DataGrid>
  408. </ScrollViewer>
  409. </Grid>
  410. </UserControl>