|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <UserControl x:Class="BPASmart.UserManagement.View.EditPower"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmart.UserManagement.View"
- xmlns:vm="clr-namespace:BPASmart.UserManagement.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800" FontFamily="楷体">
- <UserControl.DataContext>
- <vm:EditPowerViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <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>
- </UserControl.Resources>
- <Border Margin="10,20">
- <Border.Background>
- <ImageBrush ImageSource="pack://application:,,,/BPASmart.CustomResource;component/Image/方形背景2.png"/>
- </Border.Background>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="18*"/>
- <RowDefinition Height="391*"/>
- </Grid.RowDefinitions>
- <TextBlock Text="权限编辑"
- FontSize="18" Foreground="#F0FFF0"
- HorizontalAlignment="Center" VerticalAlignment="Center" Width="72"/>
- <Grid Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="3*"/>
- <RowDefinition Height="40*"/>
- <RowDefinition Height="328*"/>
- </Grid.RowDefinitions>
- <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,2"
- HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock Text="用户名:" Foreground="{DynamicResource commanTextblock}" FontSize="18"
- HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <ComboBox Width="120" Margin="20,0" ItemsSource="{Binding UserNames}" SelectedItem="{Binding CurrentUserName}" FontSize="16" Foreground="{DynamicResource commanTextblock}"
- Style="{DynamicResource CommonCombox}"/>
- <Button Content="保存" Style="{DynamicResource CommonButton}" Width="100" FontSize="18" Command="{Binding SaveUserPowerCommand}" Margin="10,0"/>
- <Button Content="取消" Style="{DynamicResource CommonButton}" Width="100" FontSize="18" Command="{Binding CancelCommand}" Margin="10,0"/>
- </StackPanel>
- <Grid Grid.Row="2" Margin="5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.15*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="0.35*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="0.15*"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="14*"/>
- <RowDefinition Height="1*"/>
- </Grid.RowDefinitions>
- <!--#region 界面列表-->
- <Border Grid.Column="1" Margin="20,0,20,0">
- <Border.Background>
- <ImageBrush ImageSource="../Image/方形背景3.png"/>
- </Border.Background>
- <ScrollViewer CanContentScroll="True" Template="{DynamicResource ScrollViewerControlTemplate1}"
- Width="auto" Margin="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
- <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}"
- ItemsSource="{Binding pageList}" >
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Button Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Style="{DynamicResource ButtontextStyle}"
- Command="{Binding DataContext.AddPageCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
- CommandParameter="{Binding Name}">
- <Border x:Name="leftborder" Width="130" HorizontalAlignment="Center" Margin="5">
- <Border.Background>
- <ImageBrush ImageSource="../Image/文字背景2.png"/>
- </Border.Background>
- <TextBlock Text="{Binding Name}" Margin="8"
- FontSize="18" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- </Button>
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Width" Value="160" TargetName="leftborder"/>
- </Trigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- </Border>
- <!--#endregion-->
-
- <Grid Grid.Column="2">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Button Width="80" Height="80" Command="{Binding AddAllPageCommand}">
- <Button.Template>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border >
- <Grid>
- <StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" >
- <TextBlock Text="全部" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
- <TextBlock Text="添加" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
- </StackPanel>
- <Border>
-
- <Border.Background>
- <ImageBrush x:Name="image" ImageSource="../Image/圆形按钮背景2.png">
- </ImageBrush>
- </Border.Background>
- <Border.Style>
- <Style TargetType="Border">
- <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
- <Setter Property="RenderTransform">
- <Setter.Value>
- <TransformGroup>
- <RotateTransform/>
- </TransformGroup>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <EventTrigger RoutedEvent="Loaded" >
- <EventTrigger.Actions>
- <BeginStoryboard x:Name="run1">
- <Storyboard RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[0].Angle">
- <DoubleAnimation From="0" To="360" Duration="0:0:6"/>
- </Storyboard>
- </BeginStoryboard>
- <PauseStoryboard BeginStoryboardName="run1"/>
- </EventTrigger.Actions>
- </EventTrigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Trigger.EnterActions>
- <ResumeStoryboard BeginStoryboardName="run1"/>
- </Trigger.EnterActions>
-
- </Trigger>
- <Trigger Property="IsMouseOver" Value="False">
- <Trigger.EnterActions>
- <PauseStoryboard BeginStoryboardName="run1"/>
- </Trigger.EnterActions>
- </Trigger>
-
- </Style.Triggers>
- </Style>
- </Border.Style>
- </Border>
-
- </Grid>
- </Border>
-
- </ControlTemplate>
- </Button.Template>
- </Button>
-
- <Button Grid.Row="1" Width="80" Height="80" Command="{Binding DeleteAllPageCommand}">
- <Button.Template>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border >
- <Grid>
- <StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" >
- <TextBlock Text="全部" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
- <TextBlock Text="移除" FontSize="20" Foreground="{DynamicResource commanTextblock}"/>
- </StackPanel>
-
- <Border x:Name="myborder">
- <Border.Background>
- <ImageBrush x:Name="image" ImageSource="../Image/圆形按钮背景1.png">
-
- </ImageBrush>
- </Border.Background>
- <Border.Style>
- <Style TargetType="Border">
- <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
- <Setter Property="RenderTransform">
- <Setter.Value>
- <TransformGroup>
- <RotateTransform/>
- </TransformGroup>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <EventTrigger RoutedEvent="Loaded" >
- <EventTrigger.Actions>
- <BeginStoryboard x:Name="run1">
- <Storyboard RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[0].Angle">
- <DoubleAnimation From="360" To="0" Duration="0:0:6"/>
- </Storyboard>
- </BeginStoryboard>
- <PauseStoryboard BeginStoryboardName="run1"/>
- </EventTrigger.Actions>
- </EventTrigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Trigger.EnterActions>
- <ResumeStoryboard BeginStoryboardName="run1"/>
-
- </Trigger.EnterActions>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="False">
- <Trigger.EnterActions>
- <PauseStoryboard BeginStoryboardName="run1" />
- </Trigger.EnterActions>
- </Trigger>
-
- </Style.Triggers>
- </Style>
- </Border.Style>
- </Border>
-
- </Grid>
- </Border>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </Grid>
- <!--#region 用户界面列表-->
- <Border Grid.Column="3" Margin="20,0,20,0">
- <Border.Background>
- <ImageBrush ImageSource="../Image/方形背景3.png"/>
- </Border.Background>
- <ScrollViewer CanContentScroll="True" Template="{DynamicResource ScrollViewerControlTemplate1}"
- Width="auto" Margin="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
- <ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}" Width="auto"
- ItemsSource="{Binding userPageList}" >
- <ListBox.Template>
- <ControlTemplate>
- <StackPanel Background="Transparent" IsItemsHost="True"></StackPanel>
- </ControlTemplate>
- </ListBox.Template>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Button Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Style="{DynamicResource ButtontextStyle}"
- Command="{Binding DataContext.DeletePageCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
- CommandParameter="{Binding Name}">
- <Border x:Name="leftborder" Width="130" HorizontalAlignment="Center" Margin="5">
- <Border.Background>
- <ImageBrush ImageSource="../Image/文字背景2.png"/>
- </Border.Background>
- <TextBlock Text="{Binding Name}" Margin="8"
- FontSize="18" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- </Button>
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Width" Value="160" TargetName="leftborder"/>
- </Trigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </ScrollViewer>
- </Border>
- <!--#endregion-->
- </Grid>
- </Grid>
- </Grid>
- </Border>
-
- </UserControl>
|