|
- <Window
- x:Class="BPASmartClient.CustomResource.Pages.View.UserConfigView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
- Title="UserConfigView"
- Width="800"
- Height="500"
- AllowsTransparency="True"
- Background="{x:Null}"
- Topmost="True"
- WindowStartupLocation="CenterScreen"
- WindowStyle="None"
- mc:Ignorable="d">
- <Window.DataContext>
- <vm:UserConfigViewModel />
- </Window.DataContext>
- <Window.Resources>
- <ImageBrush x:Key="ImageBrushAddBlue" ImageSource="../../Image/按钮/AddGreen.png" />
- <ImageBrush x:Key="ImageBrushAddGray" ImageSource="../../Image/按钮/Delete.png" />
- <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Border Background="Transparent" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="1"
- CornerRadius="2" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
- <Grid>
- <Border
- Width="0.5"
- Background="#FF046BFF"
- CornerRadius="2" />
- <Track x:Name="PART_Track" IsDirectionReversed="true">
- <Track.DecreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource ScrollBarPageButton}" />
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb
- Margin="4,0,4,0"
- Background="DodgerBlue"
- Style="{StaticResource ScrollBarThumb}" />
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="ScrollBar.PageDownCommand" Style="{StaticResource ScrollBarPageButton}" />
- </Track.IncreaseRepeatButton>
- </Track>
- </Grid>
- </ControlTemplate>
-
- <ControlTemplate x:Key="ScrollViewerControlTemplate1" TargetType="{x:Type ScrollViewer}">
- <Grid x:Name="Grid" Background="{TemplateBinding Background}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Rectangle
- x:Name="Corner"
- Grid.Row="1"
- Grid.Column="1"
- Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
- <ScrollContentPresenter
- x:Name="PART_ScrollContentPresenter"
- Grid.Row="0"
- Grid.Column="0"
- Margin="{TemplateBinding Padding}"
- CanContentScroll="{TemplateBinding CanContentScroll}"
- CanHorizontallyScroll="False"
- CanVerticallyScroll="False"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}" />
- <ScrollBar
- x:Name="PART_VerticalScrollBar"
- Grid.Row="0"
- Grid.Column="1"
- AutomationProperties.AutomationId="VerticalScrollBar"
- Cursor="Arrow"
- Maximum="{TemplateBinding ScrollableHeight}"
- Minimum="0"
- Template="{StaticResource VerticalScrollBar}"
- ViewportSize="{TemplateBinding ViewportHeight}"
- Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
- Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
- <ScrollBar
- x:Name="PART_HorizontalScrollBar"
- Grid.Row="1"
- Grid.Column="0"
- AutomationProperties.AutomationId="HorizontalScrollBar"
- Cursor="Arrow"
- Maximum="{TemplateBinding ScrollableWidth}"
- Minimum="0"
- Orientation="Horizontal"
- ViewportSize="{TemplateBinding ViewportWidth}"
- Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
- Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
- </Grid>
- </ControlTemplate>
- <!-- 对象树子模板 -->
- <DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem">
- <Grid Height="28" Margin="50,0,0,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="30" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="tb_PageName"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="White"
- Text="{Binding Name}" />
- <Button
- x:Name="BtnAdd"
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- Command="{Binding DataContext.AddUserPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeView}}"
- CommandParameter="{Binding Path=Text, ElementName=tb_PageName}">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle
- x:Name="BtnRetangle"
- Width="20"
- Height="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Fill="{StaticResource ImageBrushAddBlue}"
- Stroke="Transparent"
- StrokeThickness="1" />
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="22" />
- <Setter TargetName="BtnRetangle" Property="Width" Value="22" />
- </Trigger>
- <DataTrigger Binding="{Binding IsChecked}" Value="true">
- <Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddGray}" />
- <Setter Property="ToolTip" Value="已添加" />
- </DataTrigger>
- <DataTrigger Binding="{Binding IsChecked}" Value="false">
- <Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddBlue}" />
- <Setter Property="ToolTip" Value="添加" />
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- <Style TargetType="TreeViewItem">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="IsExpanded" Value="True" />
- <Setter Property="HeaderTemplate">
- <Setter.Value>
- <HierarchicalDataTemplate ItemTemplate="{StaticResource TreeItemTemplate}" ItemsSource="{Binding TreeViewItems, Mode=TwoWay}">
- <StackPanel
- Height="28"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <!-- Image Source="folder.png" VerticalAlignment="Center" Height="17" Margin="10,0"/> -->
- <TextBlock
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="White"
- Text="{Binding Name}" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TreeViewItem}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Border
- x:Name="Bd"
- Grid.Column="0"
- Padding="{TemplateBinding Padding}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <ContentPresenter
- x:Name="PART_Header"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- ContentSource="Header" />
- </Border>
- <ItemsPresenter
- x:Name="ItemsHost"
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Visibility="Collapsed" />
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="SelectionStates">
- <VisualState x:Name="Selected">
- <Storyboard>
- <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
- <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
- </ColorAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
-
- <VisualState x:Name="Unselected" />
- <VisualState x:Name="SelectedInactive">
- <Storyboard>
- <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
- <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
- </ColorAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- <VisualStateGroup x:Name="ExpansionStates">
- <VisualState x:Name="Expanded">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Visibility)">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Collapsed" />
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- </Grid>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="HasHeader" Value="false" />
- <Condition Property="Width" Value="Auto" />
- </MultiTrigger.Conditions>
- <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="HasHeader" Value="false" />
- <Condition Property="Height" Value="Auto" />
- </MultiTrigger.Conditions>
- <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="ItemContainer" TargetType="{x:Type ListBoxItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border
- x:Name="IconBorder"
- Background="Transparent"
- BorderThickness="0"
- CornerRadius="4">
- <ContentPresenter />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="true">
- <Setter TargetName="IconBorder" Property="BitmapEffect">
- <Setter.Value>
- <OuterGlowBitmapEffect GlowColor="Transparent" GlowSize="5" />
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!-- 切换button -->
- <Style x:Key="changebutton_local" TargetType="Button">
- <Setter Property="Height" Value="32" />
- <Setter Property="Width" Value="130" />
- <Setter Property="FontSize" Value="18" />
- <Setter Property="Foreground" Value="White" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border
- x:Name="border"
- BorderBrush="White"
- BorderThickness="0"
- SnapsToDevicePixels="True">
- <Border.Background>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen
- x:Name="pen"
- Brush="{TemplateBinding BorderBrush}"
- Thickness="3" />
- </GeometryDrawing.Pen>
- <GeometryDrawing.Geometry>
- <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Border.Background>
- <TextBlock
- Margin="0,5,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- Foreground="{TemplateBinding Foreground}"
- Text="{TemplateBinding Content}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True" />
- <DataTrigger Binding="{Binding IsChecked}" Value="true">
- <Setter Property="Height" Value="43" />
- <Setter Property="Width" Value="133" />
- <Setter Property="Effect">
- <Setter.Value>
- <DropShadowEffect
- Direction="220"
- Opacity="1"
- ShadowDepth="15"
- Color="Black" />
- </Setter.Value>
- </Setter>
- <Setter TargetName="border" Property="Background">
- <Setter.Value>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen Brush="White" Thickness="5" />
- </GeometryDrawing.Pen>
- <GeometryDrawing.Geometry>
- <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L200 80 L50 80 L60 130 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
-
- <Style.Triggers />
- </Style>
-
- <Style x:Key="changebutton_device" TargetType="Button">
- <Setter Property="Height" Value="32" />
- <Setter Property="Width" Value="130" />
- <Setter Property="FontSize" Value="18" />
- <Setter Property="Foreground" Value="White" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border
- x:Name="border"
- BorderBrush="White"
- BorderThickness="0"
- SnapsToDevicePixels="True">
- <Border.Background>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen
- x:Name="pen"
- Brush="{TemplateBinding BorderBrush}"
- Thickness="3" />
- </GeometryDrawing.Pen>
- <GeometryDrawing.Geometry>
- <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Border.Background>
- <TextBlock
- Margin="0,5,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- Foreground="{TemplateBinding Foreground}"
- Text="{TemplateBinding Content}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True" />
- <DataTrigger Binding="{Binding IsChecked}" Value="false">
- <Setter Property="Height" Value="43" />
- <Setter Property="Width" Value="133" />
- <Setter Property="Effect">
- <Setter.Value>
- <DropShadowEffect
- Direction="220"
- Opacity="1"
- ShadowDepth="15"
- Color="Black" />
- </Setter.Value>
- </Setter>
- <Setter TargetName="border" Property="Background">
- <Setter.Value>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen Brush="White" Thickness="5" />
- </GeometryDrawing.Pen>
- <GeometryDrawing.Geometry>
- <PathGeometry Figures="m-70 -80 L200 -80 L200 80 L200 80 L50 80 L60 130 L70 80 L-70 80 A 10,10 0 0 1 -80,70 L-80 70 L-80 -70 A 10,10 0 0 1 -70,-80" />
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
-
- </Style>
-
- <Style x:Key="closeBtn" TargetType="Button">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Grid Name="gr">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="../../Fonts/#iconfont"
- FontSize="30"
- Foreground="White"
- Text="" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="gr" Property="Background" Value="#22009DFF" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="btn" TargetType="Button">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border
- Name="gr"
- Background="{TemplateBinding Background}"
- CornerRadius="5"
- Opacity="0.8">
- <ContentPresenter
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="gr" Property="Opacity" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- </Window.Resources>
- <Border
- x:Name="br"
- Background="Transparent"
- BorderBrush="#064d87"
- BorderThickness="2">
- <Border.Effect>
- <DropShadowEffect
- BlurRadius="10"
- ShadowDepth="1"
- Color="#009DFF" />
- </Border.Effect>
- <Grid Background="#061c43">
- <!--<Image Source="../../Image/权限背景.png" Stretch="Fill" />-->
- <Grid Background="Transparent">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="20" />
- <RowDefinition />
- <RowDefinition Height="60" />
- <!--<RowDefinition Height="13*" />
- <RowDefinition Height="50" />
- <RowDefinition Height="5" />-->
- </Grid.RowDefinitions>
-
- <Border BorderBrush="#064d87" BorderThickness="0,0,0,2">
- <Border.Background>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#064d87" />
- <GradientStop Offset="1" Color="#99064d87" />
- </LinearGradientBrush>
- </Border.Background>
- </Border>
-
- <Button
- Width="40"
- HorizontalAlignment="Right"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Command="{Binding CancelCommand}"
- Style="{StaticResource closeBtn}" />
-
- <!--<TextBlock
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontFamily="../../Fonts/#iconfont"
- FontSize="30"
- Foreground="White"
- Text="" />-->
-
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <TextBlock
- HorizontalAlignment="Center"
- FontSize="24"
- Foreground="#ddd"
- Text="{Binding UserName}" />
- <TextBlock
- Margin="10,0,0,0"
- HorizontalAlignment="Center"
- FontSize="24"
- Foreground="#ddd"
- Text="权限分配" />
- </StackPanel>
-
-
- <!--<TextBlock
- Grid.Row="1"
- Margin="10,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="20"
- Foreground="#ddd"
- Text="页面权限分配" />-->
- <!--<TextBlock
- Grid.Row="3"
- Margin="10,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"
- Text="配料权限分配" />-->
-
- <Grid Grid.Row="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="120" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="50" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Column="0"
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"
- Text="权限列表"
- TextWrapping="Wrap" />
- <TextBlock
- Grid.Column="4"
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"
- Text="当前用户权限"
- TextWrapping="Wrap" />
- <!--#region 页面权限-->
- <Border
- Grid.Column="1"
- BorderBrush="#1874CD"
- BorderThickness="1" />
- <Border
- Grid.Column="3"
- BorderBrush="#1874CD"
- BorderThickness="1" />
- <ScrollViewer
- Grid.Column="1"
- Margin="20,5,5,5"
- CanContentScroll="True"
- Template="{StaticResource ScrollViewerControlTemplate1}">
- <TreeView
- x:Name="MyTreeView"
- HorizontalAlignment="Stretch"
- Background="Transparent"
- BorderBrush="Transparent"
- ItemsSource="{Binding pageTreeViewModels}"
- ScrollViewer.VerticalScrollBarVisibility="Disabled" />
- </ScrollViewer>
- <ScrollViewer
- Grid.Column="3"
- Margin="10,0,10,0"
- CanContentScroll="True"
- Template="{StaticResource ScrollViewerControlTemplate1}">
- <ListBox
- x:Name="RightListBox"
- Grid.Column="3"
- Background="Transparent"
- FocusVisualStyle="{x:Null}"
- ItemContainerStyle="{StaticResource ItemContainer}"
- ItemsSource="{Binding SelectePage}">
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True" />
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="60" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="tb_Name"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="White"
- Text="{Binding Name}" />
- <Button
- x:Name="BtnDelete"
- Grid.Column="1"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Background="Transparent"
- Command="{Binding DataContext.DeleteUserPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
- ToolTip="移除">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle
- x:Name="BtnRetangle"
- Width="17"
- Height="17"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Stroke="Transparent"
- StrokeThickness="1">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/Delete.png" />
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
- <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- <StackPanel
- Grid.Column="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Button
- Width="100"
- Height="40"
- Margin="10,20"
- Background="#064d87"
- Command="{Binding AddAllCommand}"
- CommandParameter="page"
- Content="全部添加"
- FontSize="16"
- Foreground="White"
- Style="{StaticResource btn}" />
- <Button
- Width="100"
- Height="40"
- Margin="10,20"
- Background="#064d87"
- Command="{Binding DeleteAllCommand}"
- CommandParameter="page"
- Content="全部移除"
- FontSize="16"
- Foreground="White"
- Style="{StaticResource btn}" />
- </StackPanel>
-
- <!--#endregion-->
- </Grid>
-
- <Grid Grid.Row="4" Visibility="Collapsed">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="100" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="50" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="60" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <TextBlock
- Grid.Row="1"
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"
- Text="权限列表"
- TextWrapping="Wrap" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="4"
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"
- Text="当前用户权限"
- TextWrapping="Wrap" />
-
- <Button
- Grid.Column="1"
- HorizontalAlignment="Right"
- Command="{Binding ChangeMaterailPageCommand}"
- CommandParameter="Local"
- Content="本地原料"
- Style="{DynamicResource changebutton_local}" />
- <Button
- Grid.Column="3"
- HorizontalAlignment="Left"
- Command="{Binding ChangeMaterailPageCommand}"
- CommandParameter="Device"
- Content="设备原料"
- Style="{DynamicResource changebutton_device}" />
- <!--#region 本地原料权限-->
- <Border
- Grid.Row="1"
- Grid.Column="1"
- Grid.ColumnSpan="3"
- BorderBrush="#1874CD"
- BorderThickness="1"
- Visibility="{Binding VisibilityLocal}">
- <Grid Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="100" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <Border
- Grid.Column="0"
- BorderBrush="#1874CD"
- BorderThickness="1" />
- <Border
- Grid.Column="2"
- BorderBrush="#1874CD"
- BorderThickness="1" />
- <ScrollViewer
- Width="230"
- Margin="20,5,5,5"
- HorizontalAlignment="Right"
- CanContentScroll="True"
- Template="{StaticResource ScrollViewerControlTemplate1}">
- <ListBox
- Background="Transparent"
- FocusVisualStyle="{x:Null}"
- ItemContainerStyle="{StaticResource ItemContainer}"
- ItemsSource="{Binding LoaclMaterails}">
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True" />
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="60" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="tb_Name"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="White"
- Text="{Binding RawMaterialName}" />
- <Button
- x:Name="BtnDelete"
- Grid.Column="1"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Background="Transparent"
- Command="{Binding DataContext.AddLoaclMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
- ToolTip="移除">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle
- x:Name="BtnRetangle"
- Width="17"
- Height="17"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Stroke="Transparent"
- StrokeThickness="1">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/AddGreen.png" />
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
- <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
-
-
- <ScrollViewer
- Grid.Column="2"
- Margin="10,0,10,0"
- CanContentScroll="True"
- Template="{StaticResource ScrollViewerControlTemplate1}">
- <ListBox
- Width="230"
- Background="Transparent"
- FocusVisualStyle="{x:Null}"
- ItemContainerStyle="{StaticResource ItemContainer}"
- ItemsSource="{Binding UserLoaclMaterails}">
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True" />
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="60" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="tb_Name"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="White"
- Text="{Binding RawMaterialName}" />
- <Button
- x:Name="BtnDelete"
- Grid.Column="1"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Background="Transparent"
- Command="{Binding DataContext.DeleteLoaclMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
- ToolTip="移除">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle
- x:Name="BtnRetangle"
- Width="17"
- Height="17"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Stroke="Transparent"
- StrokeThickness="1">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/Delete.png" />
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
- <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- <StackPanel
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Button
- Width="70"
- Height="50"
- Margin="10,20"
- Background="#009DFF"
- Command="{Binding AddAllCommand}"
- CommandParameter="local"
- FontSize="16"
- Foreground="White">
- <TextBlock Text="全部 添加" TextWrapping="Wrap" />
- </Button>
- <Button
- Width="70"
- Height="50"
- Margin="10,20"
- Background="#009DFF"
- Command="{Binding DeleteAllCommand}"
- CommandParameter="local"
- FontSize="16"
- Foreground="White">
- <TextBlock Text="全部 移除" TextWrapping="Wrap" />
- </Button>
- </StackPanel>
-
-
-
- </Grid>
- </Border>
- <!--#endregion-->
-
- <!--#region 设备原料权限-->
- <Border
- Grid.Row="1"
- Grid.Column="1"
- Grid.ColumnSpan="3"
- BorderBrush="#1874CD"
- BorderThickness="1"
- Visibility="{Binding VisibilityDevice}">
- <Grid Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="100" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <Border
- Grid.Column="0"
- BorderBrush="#1874CD"
- BorderThickness="1" />
- <Border
- Grid.Column="2"
- BorderBrush="#1874CD"
- BorderThickness="1" />
- <ScrollViewer
- Width="230"
- Margin="20,5,5,5"
- HorizontalAlignment="Right"
- CanContentScroll="True"
- Template="{StaticResource ScrollViewerControlTemplate1}">
- <ListBox
- Background="Transparent"
- FocusVisualStyle="{x:Null}"
- ItemContainerStyle="{StaticResource ItemContainer}"
- ItemsSource="{Binding DeviceMaterails}">
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True" />
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="60" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="tb_Name"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="White"
- Text="{Binding RawMaterialName}" />
- <Button
- x:Name="BtnDelete"
- Grid.Column="1"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Background="Transparent"
- Command="{Binding DataContext.AddDeviceMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
- ToolTip="移除">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle
- x:Name="BtnRetangle"
- Width="17"
- Height="17"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Stroke="Transparent"
- StrokeThickness="1">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/AddGreen.png" />
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
- <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
-
-
- <ScrollViewer
- Grid.Column="2"
- Margin="10,0,10,0"
- CanContentScroll="True"
- Template="{StaticResource ScrollViewerControlTemplate1}">
- <ListBox
- Width="230"
- Background="Transparent"
- FocusVisualStyle="{x:Null}"
- ItemContainerStyle="{StaticResource ItemContainer}"
- ItemsSource="{Binding UserDeviceMaterails}">
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True" />
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="60" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="tb_Name"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="15"
- Foreground="White"
- Text="{Binding RawMaterialName}" />
- <Button
- x:Name="BtnDelete"
- Grid.Column="1"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Background="Transparent"
- Command="{Binding DataContext.DeleteDeviceMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text, ElementName=tb_Name}"
- ToolTip="移除">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle
- x:Name="BtnRetangle"
- Width="17"
- Height="17"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Stroke="Transparent"
- StrokeThickness="1">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/Delete.png" />
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19" />
- <Setter TargetName="BtnRetangle" Property="Width" Value="19" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- <StackPanel
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Button
- Width="70"
- Height="50"
- Margin="10,20"
- Background="#009DFF"
- Command="{Binding AddAllCommand}"
- CommandParameter="device"
- FontSize="16"
- Foreground="White">
- <TextBlock Text="全部 添加" TextWrapping="Wrap" />
- </Button>
- <Button
- Width="70"
- Height="50"
- Margin="10,20"
- Background="#009DFF"
- Command="{Binding DeleteAllCommand}"
- CommandParameter="device"
- FontSize="16"
- Foreground="White">
- <TextBlock Text="全部 移除" TextWrapping="Wrap" />
- </Button>
- </StackPanel>
-
-
-
- </Grid>
- </Border>
- <!--#endregion-->
- </Grid>
- <Border
- Grid.Row="3"
- Margin="0,5,0,0"
- BorderBrush="#064d87"
- BorderThickness="0,1,0,0">
- <StackPanel
- Margin="0,0,50,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <Button
- Width="120"
- Height="40"
- Margin="0,0,50,0"
- HorizontalAlignment="Right"
- Background="#064d87"
- BorderThickness="0"
- Command="{Binding SaveCommand}"
- Content="保存"
- FontSize="20"
- Foreground="White"
- Style="{StaticResource btn}"
- TabIndex="3" />
- <Button
- Grid.Column="1"
- Width="120"
- Height="40"
- HorizontalAlignment="Left"
- Background="#064d87"
- BorderThickness="0"
- Command="{Binding CancelCommand}"
- Content="取消"
- FontSize="20"
- Foreground="White"
- Style="{StaticResource btn}"
- TabIndex="3" />
- </StackPanel>
- </Border>
- </Grid>
-
- </Grid>
- </Border>
- </Window>
|