|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- <UserControl
- x:Class="BPASmartClient.CustomResource.Pages.View.UserManagerView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters"
- 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"
- Width="1400"
- Height="900"
- Background="{x:Null}"
- mc:Ignorable="d">
- <UserControl.DataContext>
- <vm:UserManagerViewModel />
- </UserControl.DataContext>
- <UserControl.Resources>
- <!--<Style x:Key="CommonTextBlockStyle" TargetType="TextBlock">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="#B1E8FF" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
- <Style TargetType="{x:Type DataGridCell}">
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="TextBlock.FontSize" Value="13" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="#87CEFA" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content.Text}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type DataGridCell}">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="1"
- SnapsToDevicePixels="True">
- -->
- <!-- HorizontalAlignment 可以设置内容展示位置 -->
- <!--
- <ContentPresenter
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Opacity" Value=".56" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="DataGridRow">
- <Setter Property="FontSize" Value="16" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="Margin" Value="0,5" />
- <Style.Triggers>
- -->
- <!-- 隔行换色 -->
- <!--
- <Trigger Property="AlternationIndex" Value="0">
- <Setter Property="Background" Value="Transparent" />
- </Trigger>
- <Trigger Property="AlternationIndex" Value="1">
- <Setter Property="Background" Value="Transparent" />
- </Trigger>
-
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#87CEFA" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="DataGridColumnHeader">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="MinWidth" Value="0" />
- <Setter Property="MinHeight" Value="40" />
- <Setter Property="Foreground" Value="#ddd" />
- <Setter Property="FontSize" Value="26" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="DataGridColumnHeader">
-
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <ContentPresenter
- Margin="0,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center" />
- <Path
- x:Name="SortArrow"
- Grid.Column="0"
- Width="8"
- Height="6"
- Margin="0,0,50,0"
- VerticalAlignment="Center"
- Data="M0,0 L1,0 0.5,1 z"
- Fill="Transparent"
- RenderTransformOrigin="1,1"
- Stretch="Fill"
- Visibility="Collapsed" />
- <Rectangle
- Grid.ColumnSpan="1"
- Width="1"
- HorizontalAlignment="Right"
- Fill="#87CEFA" />
- </Grid>
-
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Height" Value="25" />
- </Style>
- <Style x:Key="datagridButton" TargetType="Button">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="Foreground" Value="#1874CD" />
- <Setter Property="FontSize" Value="18" />
- </Style>-->
-
-
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalDataTableStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
-
-
- </UserControl.Resources>
- <Grid>
- <!--<Grid.ColumnDefinitions>
-
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="50"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="100"/>
- </Grid.RowDefinitions>-->
-
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <!--<TextBlock Text="用户管理" FontSize="28" Style="{DynamicResource CommonTextBlockStyle}"/>-->
- <!--<DataGrid
- Grid.Row="1"
- Margin="30"
- VerticalAlignment="Top"
- AlternationCount="2"
- AutoGenerateColumns="False"
- Background="Transparent"
- CanUserAddRows="False"
- CanUserReorderColumns="False"
- CanUserResizeColumns="False"
- CanUserResizeRows="False"
- FrozenColumnCount="1"
- IsReadOnly="True"
- ItemsSource="{Binding userManager}"
- RowHeaderWidth="0"
- RowHeight="35"
- SelectionMode="Single"
- Visibility="Hidden">
- <DataGrid.Columns>
- <DataGridTemplateColumn Width="200" Header="用户名">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock
- FontSize="20"
- Foreground="White"
- Text="{Binding UserName}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Width="300" Header="最后登录时间">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock
- FontSize="20"
- Foreground="White"
- Text="{Binding LastLogInTime}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Width="250" Header="权限">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <Button
- Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
- Content="权限"
- Style="{DynamicResource datagridButton}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Width="250" Header="重置密码">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <Button
- Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
- Content="重置密码"
- Style="{DynamicResource datagridButton}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <DataGridTemplateColumn Width="*" Header="删除">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <Button
- Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
- Content="删除"
- Style="{DynamicResource datagridButton}" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
-
- </DataGrid>-->
-
-
- <!--#region 列表-->
- <!--#region 表格标题栏设置-->
- <Grid
- Grid.Row="1"
- Margin="0,10,0,0"
- Background="#ff0C255F">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
-
- <TextBlock
- Grid.Column="0"
- Style="{StaticResource TitleTextblockStyle}"
- Text="用户名" />
-
- <Grid Grid.Column="1">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="最后登录时间" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- Style="{StaticResource TitleTextblockStyle}"
- Text="权限" />
-
- <Grid Grid.Column="3">
- <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="重置密码" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="4"
- Style="{StaticResource TitleTextblockStyle}"
- Text="删除" />
-
- <Border
- Grid.ColumnSpan="10"
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0" />
-
- </Grid>
- <!--#endregion-->
-
- <Grid Grid.Row="2">
- <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
- <ItemsControl ItemsSource="{Binding userManager}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid Name="gr" Height="30">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- Foreground="{StaticResource tabColor}"
- Style="{StaticResource DisiableTextblockStyle}"
- Text="{Binding UserName}" />
-
- <Grid Grid.Column="1">
- <TextBlock
- Foreground="{StaticResource tabColor}"
- Style="{StaticResource DisiableTextblockStyle}"
- Text="{Binding LastLogInTime}" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Button
- Grid.Column="2"
- Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
- CommandParameter="{Binding}"
- Content="权限"
- Foreground="{StaticResource tabColor}"
- Style="{StaticResource ControlButtonStyle}" />
-
- <Grid Grid.Column="3">
- <Button
- Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
- CommandParameter="{Binding}"
- Content="重置密码"
- Style="{StaticResource ControlButtonStyle}" />
- <Border
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <Button
- Grid.Column="4"
- Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
- CommandParameter="{Binding}"
- Content="删除"
- Style="{StaticResource RemoveButtonStyle}" />
-
- <Border
- Grid.ColumnSpan="10"
- BorderBrush="{StaticResource bordColor}"
- BorderThickness="1,0,1,1" />
-
- </Grid>
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- <!--#endregion-->
-
- <Button
- Width="200"
- Height="50"
- Margin="10,0"
- HorizontalAlignment="Right"
- Command="{Binding AddNewUserCommand}"
- Content="添加新用户"
- FontSize="24"
- Style="{StaticResource ImageButtonStyle}" />
-
- <!--<Button Grid.Row="2"
- Height="50" Width="200"
- Background="#009DFF"
- BorderThickness="0"
- Command="{Binding AddNewUserCommand}"
- Content="添加新用户"
- FontSize="24"
- Foreground="White" />-->
- </Grid>
- </UserControl>
|