RoleView.xaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <UserControl x:Class="Venus_MainPages.Views.RoleView"
  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:Venus_MainPages.Views"
  7. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  8. xmlns:prism="http://prismlibrary.com/"
  9. xmlns:customControls="clr-namespace:Venus_Themes.CustomControls;assembly=Venus_Themes"
  10. xmlns:unity="clr-namespace:Venus_MainPages.Unity"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. mc:Ignorable="d"
  13. d:DesignHeight="450" d:DesignWidth="800" Name="roleView">
  14. <i:Interaction.Triggers>
  15. <i:EventTrigger EventName="Loaded">
  16. <i:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=roleView}"/>
  17. </i:EventTrigger>
  18. </i:Interaction.Triggers>
  19. <Canvas>
  20. <TreeView ItemsSource="{Binding Roles}" Canvas.Left="10" x:Name="roleTreeView">
  21. <i:Interaction.Triggers>
  22. <i:EventTrigger EventName="SelectedItemChanged">
  23. <i:InvokeCommandAction Command="{Binding SelectedItemChangedCommand}"/>
  24. </i:EventTrigger>
  25. </i:Interaction.Triggers>
  26. </TreeView>
  27. <StackPanel Orientation="Horizontal" Canvas.Left="150" Canvas.Top="30">
  28. <TextBlock Text="IsLock" FontSize="20"/>
  29. <CheckBox Canvas.Left="200" Canvas.Top="10" Margin="4"/>
  30. </StackPanel>
  31. <StackPanel Orientation="Horizontal" Canvas.Left="150" Canvas.Top="70">
  32. <TextBlock Text="LockTime:" FontSize="20"/>
  33. <TextBox Width="100" FontSize="20" BorderThickness="0,0,0,1" BorderBrush="Black" Background="Transparent"/>
  34. <TextBlock Text="(s)" FontSize="20"/>
  35. </StackPanel>
  36. <customControls:PathButton Content="Save" Width="120" Height="33" Canvas.Left="400" Canvas.Top="66" Command="{Binding SaveCommand}"/>
  37. <DataGrid ItemsSource="{Binding Menus}" AlternationCount="2"
  38. SelectionUnit="Cell"
  39. FontSize="20"
  40. Height="700"
  41. Canvas.Top="110"
  42. Canvas.Left="10"
  43. AutoGenerateColumns="False" HorizontalAlignment="Center" VerticalAlignment="Top" CanUserAddRows="False">
  44. <DataGrid.Columns>
  45. <DataGridTemplateColumn Header="FirstMenu" Width="200" >
  46. <DataGridTemplateColumn.CellTemplate>
  47. <DataTemplate>
  48. <TextBlock Text="{Binding FirstMenu}"/>
  49. </DataTemplate>
  50. </DataGridTemplateColumn.CellTemplate>
  51. </DataGridTemplateColumn>
  52. <DataGridTemplateColumn Header="SecondMenu" Width="200" IsReadOnly="True">
  53. <DataGridTemplateColumn.CellTemplate>
  54. <DataTemplate>
  55. <TextBlock Text="{Binding SecondMenu}"/>
  56. </DataTemplate>
  57. </DataGridTemplateColumn.CellTemplate>
  58. </DataGridTemplateColumn>
  59. <DataGridTemplateColumn Header="Permission" Width="200" >
  60. <DataGridTemplateColumn.CellTemplate>
  61. <DataTemplate>
  62. <ComboBox SelectedItem="{Binding Permission,UpdateSourceTrigger=PropertyChanged}" unity:ItemsControlHelper.EnumValuesToItemsSource="True" />
  63. </DataTemplate>
  64. </DataGridTemplateColumn.CellTemplate>
  65. </DataGridTemplateColumn>
  66. </DataGrid.Columns>
  67. <DataGrid.GroupStyle>
  68. <GroupStyle >
  69. <GroupStyle.ContainerStyle>
  70. <Style TargetType="{x:Type GroupItem}">
  71. <Setter Property="Template">
  72. <Setter.Value>
  73. <ControlTemplate TargetType="{x:Type GroupItem}">
  74. <Expander IsExpanded="True" Style="{StaticResource ExpanderStyle}" ExpandDirection="Down" SnapsToDevicePixels="True" VerticalAlignment="Top">
  75. <Expander.Header>
  76. <Border BorderBrush="Gray" BorderThickness="0,0,0,1">
  77. <StackPanel Orientation="Horizontal">
  78. <TextBlock Text="{Binding Name}" Width="120" Foreground="Red"/>
  79. <TextBlock Text=" Count:" Foreground="Red"/>
  80. <TextBlock Text="{Binding ItemCount}" Foreground="Red"/>
  81. </StackPanel>
  82. </Border>
  83. </Expander.Header>
  84. <ItemsPresenter/>
  85. </Expander>
  86. </ControlTemplate>
  87. </Setter.Value>
  88. </Setter>
  89. </Style>
  90. </GroupStyle.ContainerStyle>
  91. </GroupStyle>
  92. </DataGrid.GroupStyle>
  93. <DataGrid.RowStyle>
  94. <Style TargetType="{x:Type DataGridRow}">
  95. <Style.Triggers>
  96. <Trigger Property="ItemsControl.AlternationIndex"
  97. Value="0">
  98. <Setter Property="Background" Value="#EEEEEE" />
  99. </Trigger>
  100. <Trigger Property="ItemsControl.AlternationIndex"
  101. Value="1">
  102. <Setter Property="Background" Value="#DEDEDE" />
  103. </Trigger>
  104. </Style.Triggers>
  105. </Style>
  106. </DataGrid.RowStyle>
  107. </DataGrid>
  108. </Canvas>
  109. </UserControl>