|
- <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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
- xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
- Title="UserConfigView" Width="800"
- Height="1000"
- 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>
- <ImageBrush x:Key="ImageBrushAddGray" ImageSource="../../Image/按钮/Delete.png"></ImageBrush>
- <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 CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
- <Grid>
- <Border CornerRadius="2" Width="0.5" Background="#FF046BFF" />
- <Track x:Name="PART_Track" IsDirectionReversed="true">
- <Track.DecreaseRepeatButton>
- <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
- </Track.DecreaseRepeatButton>
- <Track.Thumb>
- <Thumb Style="{StaticResource ScrollBarThumb}" Margin="4,0,4,0" Background="DodgerBlue"></Thumb>
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
- </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.Column="1" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1"/>
- <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
- <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1"
- Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
- Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"
- Template="{StaticResource VerticalScrollBar}"/>
- <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
- </Grid>
- </ControlTemplate>
- <!--对象树子模板-->
- <DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem">
- <Grid Margin="50,0,0,0" Height="28">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="30"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="tb_PageName" Text="{Binding Name}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0"/>
- <Button x:Name="BtnAdd" Grid.Column="1" Background="Transparent" VerticalAlignment="Center" HorizontalAlignment="Center"
- 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" Height="20" Width="20" Stroke="Transparent" StrokeThickness="1"
- Fill="{StaticResource ImageBrushAddBlue}"
- VerticalAlignment="Center" HorizontalAlignment="Center">
- </Rectangle>
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="22"></Setter>
- <Setter TargetName="BtnRetangle" Property="Width" Value="22"></Setter>
- </Trigger>
- <DataTrigger Binding="{Binding IsChecked}" Value="true">
- <Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddGray}"></Setter>
- <Setter Property="ToolTip" Value="已添加"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding IsChecked}" Value="false">
- <Setter TargetName="BtnRetangle" Property="Fill" Value="{StaticResource ImageBrushAddBlue}"></Setter>
- <Setter Property="ToolTip" Value="添加"></Setter>
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- <Style TargetType="TreeViewItem">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="IsExpanded" Value="True"></Setter>
- <Setter Property="HeaderTemplate">
- <Setter.Value>
- <HierarchicalDataTemplate ItemsSource="{Binding TreeViewItems,Mode=TwoWay}" ItemTemplate="{StaticResource TreeItemTemplate}">
- <StackPanel Orientation="Horizontal" Height="28" VerticalAlignment="Center" HorizontalAlignment="Left">
- <!--Image Source="folder.png" VerticalAlignment="Center" Height="17" Margin="10,0"/>-->
- <TextBlock Text="{Binding Name}" Margin="5,0,0,0" FontSize="15" VerticalAlignment="Center" Foreground="White"/>
- </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>
- <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.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ItemsHost">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Collapsed" />
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- <Border x:Name="Bd" Grid.Column="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
- <ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
- </Border>
- <ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Visibility="Collapsed" />
- </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" CornerRadius="4" BorderThickness="0">
- <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" BorderThickness="0" BorderBrush="White" SnapsToDevicePixels="True">
- <Border.Background>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen x:Name="pen" Thickness="3" Brush="{TemplateBinding BorderBrush }" ></Pen>
- </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"></PathGeometry>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Border.Background>
- <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,5,0,0" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
-
- </Trigger>
- <DataTrigger Binding="{Binding IsChecked}" Value="true">
- <Setter Property="Height" Value="43"/>
- <Setter Property="Width" Value="133"/>
- <Setter Property="Effect">
- <Setter.Value>
- <DropShadowEffect Color="Black" Direction="220" ShadowDepth="15" Opacity="1"/>
- </Setter.Value>
- </Setter>
- <Setter TargetName="border" Property="Background" >
- <Setter.Value>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen Thickness="5" Brush="White" ></Pen>
- </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"></PathGeometry>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
-
- <Style.Triggers>
-
- </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" BorderThickness="0" BorderBrush="White" SnapsToDevicePixels="True">
- <Border.Background>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen x:Name="pen" Thickness="3" Brush="{TemplateBinding BorderBrush }" ></Pen>
- </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"></PathGeometry>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Border.Background>
- <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,5,0,0" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
-
- </Trigger>
- <DataTrigger Binding="{Binding IsChecked}" Value="false">
- <Setter Property="Height" Value="43"/>
- <Setter Property="Width" Value="133"/>
- <Setter Property="Effect">
- <Setter.Value>
- <DropShadowEffect Color="Black" Direction="220" ShadowDepth="15" Opacity="1"/>
- </Setter.Value>
- </Setter>
- <Setter TargetName="border" Property="Background" >
- <Setter.Value>
- <DrawingBrush>
- <DrawingBrush.Drawing>
- <GeometryDrawing Brush="#009DFF">
- <GeometryDrawing.Pen>
- <Pen Thickness="5" Brush="White" ></Pen>
- </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"></PathGeometry>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
-
- </Style>
-
-
-
-
- </Window.Resources>
- <Border Background="Black"
- x:Name="br"
- BorderBrush="#009dff"
- BorderThickness="2">
- <Border.Effect>
- <DropShadowEffect
- BlurRadius="10"
- ShadowDepth="1"
- Color="#009DFF" />
- </Border.Effect>
- <Grid>
- <Image Source="../../Image/权限背景.png" Stretch="Fill"/>
- <Grid Background="Transparent">
- <Grid.RowDefinitions>
- <RowDefinition Height="60"/>
- <RowDefinition Height="40"/>
- <RowDefinition Height="10*"/>
- <RowDefinition Height="40"/>
- <RowDefinition Height="13*"/>
- <RowDefinition Height="50"/>
- <RowDefinition Height="5"/>
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock Text="{Binding UserName}" HorizontalAlignment="Center"
- FontSize="24"
- Foreground="#ddd"/>
- <TextBlock Text="权限分配" Margin="10,0,0,0"
- HorizontalAlignment="Center"
- FontSize="24"
- Foreground="#ddd"/>
- </StackPanel>
- <TextBlock Grid.Row="1"
- Text="页面权限分配" Margin="10,0,0,0"
- HorizontalAlignment="Center" VerticalAlignment="Top"
- FontSize="20"
- Foreground="#ddd"/>
- <TextBlock Grid.Row="3"
- Text="配料权限分配" Margin="10,0,0,0"
- HorizontalAlignment="Center" VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"/>
-
- <Grid Grid.Row="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="100"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="50"/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="权限列表" Width="20"
- TextWrapping="Wrap" Grid.Column="0"
- HorizontalAlignment="Center" VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"/>
- <TextBlock Text="当前用户权限" Width="20"
- Grid.Column="4"
- TextWrapping="Wrap"
- HorizontalAlignment="Center" VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"/>
- <!--#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" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True" >
- <TreeView x:Name="MyTreeView" ItemsSource="{Binding pageTreeViewModels}"
- ScrollViewer.VerticalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" Background="Transparent" BorderBrush="Transparent"></TreeView>
- </ScrollViewer>
-
-
- <ScrollViewer Grid.Column="3" Margin="10,0,10,0" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True">
- <ListBox x:Name="RightListBox" Grid.Column="3" Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
- ItemsSource="{Binding SelectePage}" >
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="tb_Name" Text="{Binding Name}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" />
- <Button x:Name="BtnDelete" Grid.Column="1" Background="Transparent" ToolTip="移除" VerticalAlignment="Center" HorizontalAlignment="Left"
- Command="{Binding DataContext.DeleteUserPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text,ElementName=tb_Name}">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle x:Name="BtnRetangle" Height="17" Width="17" Stroke="Transparent" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/Delete.png"></ImageBrush>
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19"></Setter>
- <Setter TargetName="BtnRetangle" Property="Width" Value="19"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- <StackPanel Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
- <Button Foreground="White" Background="#009DFF"
- FontSize="16" Height="50" Width="70" Margin="10,20"
- Command="{Binding AddAllCommand}" CommandParameter="page">
- <TextBlock Text="全部
- 添加" TextWrapping="Wrap"/>
- </Button>
- <Button Foreground="White" Background="#009DFF"
- FontSize="16" Height="50" Width="70" Margin="10,20"
- Command="{Binding DeleteAllCommand}" CommandParameter="page">
- <TextBlock Text="全部
- 移除" TextWrapping="Wrap"/>
- </Button>
- </StackPanel>
-
- <!--#endregion-->
- </Grid>
-
- <Grid Grid.Row="4">
- <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 Text="权限列表" Width="20"
- Grid.Row="1"
- TextWrapping="Wrap"
- HorizontalAlignment="Center" VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"/>
- <TextBlock Text="当前用户权限" Width="20"
- Grid.Row="1"
- Grid.Column="4"
- TextWrapping="Wrap"
- HorizontalAlignment="Center" VerticalAlignment="Center"
- FontSize="20"
- Foreground="#ddd"/>
-
- <Button Content="本地原料" Grid.Column="1" Style="{DynamicResource changebutton_local}" HorizontalAlignment="Right"
- Command="{Binding ChangeMaterailPageCommand}" CommandParameter="Local"/>
- <Button Content="设备原料" Grid.Column="3" Style="{DynamicResource changebutton_device}" HorizontalAlignment="Left"
- Command="{Binding ChangeMaterailPageCommand}" CommandParameter="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" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True" HorizontalAlignment="Right" >
- <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
- ItemsSource="{Binding LoaclMaterails}" >
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="tb_Name" Text="{Binding RawMaterialName}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" />
- <Button x:Name="BtnDelete" Grid.Column="1" Background="Transparent" ToolTip="移除" VerticalAlignment="Center" HorizontalAlignment="Left"
- Command="{Binding DataContext.AddLoaclMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text,ElementName=tb_Name}">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle x:Name="BtnRetangle" Height="17" Width="17" Stroke="Transparent" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/AddGreen.png"></ImageBrush>
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19"></Setter>
- <Setter TargetName="BtnRetangle" Property="Width" Value="19"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
-
-
- <ScrollViewer Grid.Column="2" Margin="10,0,10,0" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True">
- <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
- Width="230"
- ItemsSource="{Binding UserLoaclMaterails}" >
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="tb_Name" Text="{Binding RawMaterialName}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" />
- <Button x:Name="BtnDelete" Grid.Column="1" Background="Transparent" ToolTip="移除" VerticalAlignment="Center" HorizontalAlignment="Left"
- Command="{Binding DataContext.DeleteLoaclMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text,ElementName=tb_Name}">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle x:Name="BtnRetangle" Height="17" Width="17" Stroke="Transparent" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/Delete.png"></ImageBrush>
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19"></Setter>
- <Setter TargetName="BtnRetangle" Property="Width" Value="19"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
- <Button Foreground="White" Background="#009DFF"
- FontSize="16" Height="50" Width="70" Margin="10,20"
- Command="{Binding AddAllCommand}" CommandParameter="local">
- <TextBlock Text="全部
- 添加" TextWrapping="Wrap"/>
- </Button>
- <Button Foreground="White" Background="#009DFF"
- FontSize="16" Height="50" Width="70" Margin="10,20"
- Command="{Binding DeleteAllCommand}" CommandParameter="local">
- <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" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True" HorizontalAlignment="Right" >
- <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
- ItemsSource="{Binding DeviceMaterails}" >
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="tb_Name" Text="{Binding RawMaterialName}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" />
- <Button x:Name="BtnDelete" Grid.Column="1" Background="Transparent" ToolTip="移除" VerticalAlignment="Center" HorizontalAlignment="Left"
- Command="{Binding DataContext.AddDeviceMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text,ElementName=tb_Name}">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle x:Name="BtnRetangle" Height="17" Width="17" Stroke="Transparent" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/AddGreen.png"></ImageBrush>
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19"></Setter>
- <Setter TargetName="BtnRetangle" Property="Width" Value="19"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
-
-
- <ScrollViewer Grid.Column="2" Margin="10,0,10,0" Template="{StaticResource ScrollViewerControlTemplate1}" CanContentScroll="True">
- <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
- Width="230"
- ItemsSource="{Binding UserDeviceMaterails}" >
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Height="28" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="tb_Name" Text="{Binding RawMaterialName}" Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Left" />
- <Button x:Name="BtnDelete" Grid.Column="1" Background="Transparent" ToolTip="移除" VerticalAlignment="Center" HorizontalAlignment="Left"
- Command="{Binding DataContext.DeleteDeviceMaterialCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
- CommandParameter="{Binding Path=Text,ElementName=tb_Name}">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Grid>
- <Rectangle x:Name="BtnRetangle" Height="17" Width="17" Stroke="Transparent" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Left">
- <Rectangle.Fill>
- <ImageBrush ImageSource="../../Image/按钮/Delete.png"></ImageBrush>
- </Rectangle.Fill>
- </Rectangle>
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BtnRetangle" Property="Height" Value="19"></Setter>
- <Setter TargetName="BtnRetangle" Property="Width" Value="19"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
- <Button Foreground="White" Background="#009DFF"
- FontSize="16" Height="50" Width="70" Margin="10,20"
- Command="{Binding AddAllCommand}" CommandParameter="device">
- <TextBlock Text="全部
- 添加" TextWrapping="Wrap"/>
- </Button>
- <Button Foreground="White" Background="#009DFF"
- FontSize="16" Height="50" Width="70" Margin="10,20"
- Command="{Binding DeleteAllCommand}" CommandParameter="device">
- <TextBlock Text="全部
- 移除" TextWrapping="Wrap"/>
- </Button>
- </StackPanel>
-
-
-
- </Grid>
- </Border>
- <!--#endregion-->
- </Grid>
- <Grid Grid.Row="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Button Content="保存"
- Background="#009DFF"
- Margin="200,10,20,0"
- BorderThickness="0"
- Command="{Binding SaveCommand}"
- FontSize="20"
- Foreground="White"
- TabIndex="3" />
- <Button Content="取消" Grid.Column="1" Background="#009DFF"
- Margin="20,10,200,0"
- BorderThickness="0"
- Command="{Binding CancelCommand}"
- FontSize="20"
- Foreground="White"
- TabIndex="3"/>
- </Grid>
- </Grid>
-
- </Grid>
- </Border>
- </Window>
|