|
- <UserControl x:Class="BPASmart.UserManagement.View.UserList"
- 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="200" >
- <UserControl.DataContext>
- <vm:UserListViewModel/>
- </UserControl.DataContext>
- <UserControl.Resources>
- <SolidColorBrush x:Key="menufont" Color="#B7C5DA"/>
-
- <Style x:Key="menuText" TargetType="TextBlock">
- <Setter Property="FontFamily" Value="pack://application:,,,/Fonts/#iconfont"/>
- <Setter Property="Foreground" Value="{DynamicResource menufont}"/>
- <Setter Property="FontSize" Value="16"/>
- <Setter Property="Margin" Value="2,0"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="HorizontalAlignment" Value="Center"/>
- </Style>
-
- <Style x:Key="ItemContainer" TargetType="ListBoxItem">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Margin" Value="5"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="IconBorder" CornerRadius="4" BorderThickness="0,1,0,1" Background="Transparent" Opacity="0.8">
- <Grid Margin="20,10,0,10" HorizontalAlignment="Left" >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="auto"/>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="userIcon" Text="" FontFamily="pack://application:,,,/Fonts/#iconfont"
- Foreground="{DynamicResource commanTextblock}" FontSize="26"
- HorizontalAlignment="Center" VerticalAlignment="Center"/>
-
- <TextBlock x:Name="userText" Grid.Column="1" Text="{Binding UserName}" Foreground="{DynamicResource commanTextblock}"
- FontSize="18" FontFamily="楷体"
- HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20,5,0,0"/>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="IconBorder" Property="BorderBrush" Value="#ff8EE5EE"/>
- <Setter TargetName="IconBorder" Property="Background">
- <Setter.Value>
- <ImageBrush ImageSource="../Image/用户名边框.png"/>
- </Setter.Value>
- </Setter>
- <Setter TargetName="userText" Property="Foreground" Value="Orange"/>
- <Setter TargetName="userIcon" Property="Foreground" Value="Orange"/>
- <!--<Setter TargetName="userImage" Property="Source" Value="../image/账户黄.png"/>-->
- </Trigger>
- <Trigger Property="IsFocused" Value="true">
- <!--<Setter TargetName="IconBorder" Property="BorderBrush" Value="#ff8EE5EE"/>-->
- <Setter TargetName="IconBorder" Property="Background">
- <Setter.Value>
- <ImageBrush ImageSource="../Image/方形.png"/>
-
- </Setter.Value>
- </Setter>
- <Setter TargetName="userText" Property="Foreground" Value="Orange"/>
- <Setter TargetName="userIcon" Property="Foreground" Value="Orange"/>
- <!--<Setter TargetName="userImage" Property="Source" Value="../image/账户黄.png"/>-->
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="listbox" TargetType="ListBox">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="BorderBrush" Value="Transparent"/>
- <Setter Property="BorderThickness" Value="0"/>
- </Style>
- </UserControl.Resources>
- <Border>
- <Border.Background>
- <!--<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
- <GradientStop Color="#FF00203B" Offset="0"/>
- <GradientStop Color="#FF020026" Offset="1"/>
- </LinearGradientBrush>-->
- <ImageBrush ImageSource="../Image/用户边框1.png"/>
- </Border.Background>
-
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="12*"/>
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
- <Image Source="../image/List.png" Height="19" Margin="2,2,4,0" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
- <TextBlock Text="用户列表" Foreground="White" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center" />
- </StackPanel>
- <Border Grid.Row="1" BorderBrush="Transparent" BorderThickness="0,1,0,0">
- <ScrollViewer Background="Transparent"
- Grid.Row="1" Margin="5" Template="{DynamicResource ScrollViewerControlTemplate1 }" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
-
- <ListBox Style="{DynamicResource listbox}" ItemContainerStyle="{DynamicResource ItemContainer}" ItemsSource="{Binding userManagers}" >
- <ListBox.ContextMenu>
- <ContextMenu Height="auto">
- <MenuItem Command="{Binding RegisterNewUserCommand}" >
- <MenuItem.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource menuText}" Text=""/>
- <TextBlock Grid.Column="1" Text="注册新用户" Style="{DynamicResource menuText}" FontFamily="楷体"/>
- </Grid>
- </MenuItem.Header>
- </MenuItem>
- <MenuItem Command="{Binding ChangePasswordCommand}"
- CommandParameter="{Binding PlacementTarget.SelectedItem,RelativeSource={RelativeSource AncestorType=ContextMenu,Mode=FindAncestor}}">
- <MenuItem.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource menuText}" Text=""/>
- <TextBlock Grid.Column="1" Text="修改密码" Style="{DynamicResource menuText}" FontFamily="楷体" />
- </Grid>
- </MenuItem.Header>
- </MenuItem>
- <MenuItem Command="{Binding EditUsetPowerCommand}"
- CommandParameter="{Binding PlacementTarget.SelectedItem,RelativeSource={RelativeSource AncestorType=ContextMenu,Mode=FindAncestor}}">
- <MenuItem.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource menuText}" Text="󰈓"/>
- <TextBlock Grid.Column="1" Text="编辑权限" Style="{DynamicResource menuText}" FontFamily="楷体"/>
- </Grid>
- </MenuItem.Header>
- </MenuItem>
- <MenuItem Command="{Binding DeleteUserCommand}"
- CommandParameter="{Binding PlacementTarget.SelectedItem,RelativeSource={RelativeSource AncestorType=ContextMenu,Mode=FindAncestor}}">
- <MenuItem.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Style="{DynamicResource menuText}" Text=""/>
- <TextBlock Grid.Column="1" Text="删除用户" Style="{DynamicResource menuText}" FontFamily="楷体"/>
- </Grid>
- </MenuItem.Header>
- </MenuItem>
- </ContextMenu>
- </ListBox.ContextMenu>
-
- </ListBox>
-
- </ScrollViewer>
- </Border>
- </Grid>
- </Border>
- </UserControl>
|