124 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			124 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| 
								 | 
							
								<UserControl x:Class="DM_Weight.Views.UserManagerWindow"
							 | 
						||
| 
								 | 
							
								            xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" 
							 | 
						||
| 
								 | 
							
								            xmlns:pagination="clr-namespace:DM_Weight.Components.pagination"
							 | 
						||
| 
								 | 
							
								            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:DM_Weight.Views"
							 | 
						||
| 
								 | 
							
								            xmlns:convert="clr-namespace:DM_Weight.Converter"
							 | 
						||
| 
								 | 
							
								            xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
							 | 
						||
| 
								 | 
							
								            xmlns:prism="http://prismlibrary.com/"
							 | 
						||
| 
								 | 
							
								            mc:Ignorable="d">
							 | 
						||
| 
								 | 
							
								    <UserControl.Resources>
							 | 
						||
| 
								 | 
							
								        <Style x:Key="st" TargetType="GridViewColumnHeader">
							 | 
						||
| 
								 | 
							
								            <Style.Setters>
							 | 
						||
| 
								 | 
							
								                <Setter Property="Height">
							 | 
						||
| 
								 | 
							
								                    <Setter.Value>55</Setter.Value>
							 | 
						||
| 
								 | 
							
								                </Setter>
							 | 
						||
| 
								 | 
							
								                <Setter Property="Background">
							 | 
						||
| 
								 | 
							
								                    <Setter.Value>#31ccec</Setter.Value>
							 | 
						||
| 
								 | 
							
								                </Setter>
							 | 
						||
| 
								 | 
							
								                <Setter Property="Foreground">
							 | 
						||
| 
								 | 
							
								                    <Setter.Value>white</Setter.Value>
							 | 
						||
| 
								 | 
							
								                </Setter>
							 | 
						||
| 
								 | 
							
								            </Style.Setters>
							 | 
						||
| 
								 | 
							
								        </Style>
							 | 
						||
| 
								 | 
							
								    </UserControl.Resources>
							 | 
						||
| 
								 | 
							
								    <Grid>
							 | 
						||
| 
								 | 
							
								        <Grid.Resources>
							 | 
						||
| 
								 | 
							
								            <convert:NullableToEnabelConverter x:Key="NullableToEnabelConverter" />
							 | 
						||
| 
								 | 
							
								        </Grid.Resources>
							 | 
						||
| 
								 | 
							
								        <Grid.RowDefinitions>
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="Auto" />
							 | 
						||
| 
								 | 
							
								            <RowDefinition />
							 | 
						||
| 
								 | 
							
								            <RowDefinition Height="Auto" />
							 | 
						||
| 
								 | 
							
								        </Grid.RowDefinitions>
							 | 
						||
| 
								 | 
							
								        <Grid Margin="0 6 0 6" Grid.Row="0">
							 | 
						||
| 
								 | 
							
								            <Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								                <ColumnDefinition Width="2*" />
							 | 
						||
| 
								 | 
							
								                <ColumnDefinition Width="8*" />
							 | 
						||
| 
								 | 
							
								            </Grid.ColumnDefinitions>
							 | 
						||
| 
								 | 
							
								            
							 | 
						||
| 
								 | 
							
								            <TextBox
							 | 
						||
| 
								 | 
							
								                Grid.Column="0"
							 | 
						||
| 
								 | 
							
								                Text="{Binding SearchValue}"
							 | 
						||
| 
								 | 
							
								                materialDesign:HintAssist.Hint="姓名"
							 | 
						||
| 
								 | 
							
								                Margin="6 0 0 0"
							 | 
						||
| 
								 | 
							
								                Style="{StaticResource MaterialDesignOutlinedTextBox}"/>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
							 | 
						||
| 
								 | 
							
								                <Button
							 | 
						||
| 
								 | 
							
								                    Margin="0 0 6 0"
							 | 
						||
| 
								 | 
							
								                    VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                    Style="{StaticResource MaterialDesignOutlinedLightButton}"
							 | 
						||
| 
								 | 
							
								                    Command="{Binding OpenInsertUserDialog}"
							 | 
						||
| 
								 | 
							
								                    Content="新增"
							 | 
						||
| 
								 | 
							
								                    />
							 | 
						||
| 
								 | 
							
								                <Button
							 | 
						||
| 
								 | 
							
								                    Margin="0 0 6 0"
							 | 
						||
| 
								 | 
							
								                    VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                    Style="{StaticResource MaterialDesignOutlinedLightButton}"
							 | 
						||
| 
								 | 
							
								                    IsEnabled="{Binding User, Converter={StaticResource NullableToEnabelConverter}}"
							 | 
						||
| 
								 | 
							
								                    Command="{Binding OpenEditUserDialog}"
							 | 
						||
| 
								 | 
							
								                    Content="编辑"
							 | 
						||
| 
								 | 
							
								                    />
							 | 
						||
| 
								 | 
							
								                <Button
							 | 
						||
| 
								 | 
							
								                    Command="{Binding OpenFingerDialog}"
							 | 
						||
| 
								 | 
							
								                    IsEnabled="{Binding User, Converter={StaticResource NullableToEnabelConverter}}"
							 | 
						||
| 
								 | 
							
								                    Style="{StaticResource MaterialDesignOutlinedLightButton}"
							 | 
						||
| 
								 | 
							
								                    Margin="0 0 6 0"
							 | 
						||
| 
								 | 
							
								                    Content="录入指纹" Cursor="Hand" />
							 | 
						||
| 
								 | 
							
								                <Button
							 | 
						||
| 
								 | 
							
								                    Margin="0 0 6 0"
							 | 
						||
| 
								 | 
							
								                    VerticalAlignment="Center"
							 | 
						||
| 
								 | 
							
								                    Style="{StaticResource MaterialDesignOutlinedLightButton}"
							 | 
						||
| 
								 | 
							
								                    ToolTip="刷新" Command="{Binding Query}">
							 | 
						||
| 
								 | 
							
								                    <materialDesign:PackIcon
							 | 
						||
| 
								 | 
							
								                    Kind="Refresh" />
							 | 
						||
| 
								 | 
							
								                </Button>
							 | 
						||
| 
								 | 
							
								            </StackPanel>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        </Grid>
							 | 
						||
| 
								 | 
							
								        <ListView Grid.Row="1" ItemsSource="{Binding UserList}" 
							 | 
						||
| 
								 | 
							
								                SelectedItem="{Binding User}"
							 | 
						||
| 
								 | 
							
								                materialDesign:ListViewAssist.HeaderRowBackground="#31ccec"
							 | 
						||
| 
								 | 
							
								                materialDesign:DataGridAssist.ColumnHeaderPadding="10"
							 | 
						||
| 
								 | 
							
								                materialDesign:ListViewAssist.ListViewItemPadding="13">
							 | 
						||
| 
								 | 
							
								            <ListView.Resources>
							 | 
						||
| 
								 | 
							
								                <Style TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
							 | 
						||
| 
								 | 
							
								                    <Setter Property="Foreground" Value="White" />
							 | 
						||
| 
								 | 
							
								                </Style>
							 | 
						||
| 
								 | 
							
								            </ListView.Resources>
							 | 
						||
| 
								 | 
							
								            <ListView.View>
							 | 
						||
| 
								 | 
							
								                <GridView ColumnHeaderContainerStyle="{StaticResource st}">
							 | 
						||
| 
								 | 
							
								                    <GridViewColumn Width="200"
							 | 
						||
| 
								 | 
							
								                        Header="用户编号"
							 | 
						||
| 
								 | 
							
								                        DisplayMemberBinding="{Binding Id}"/>
							 | 
						||
| 
								 | 
							
								                    <GridViewColumn Width="305"
							 | 
						||
| 
								 | 
							
								                        Header="用户姓名"
							 | 
						||
| 
								 | 
							
								                        DisplayMemberBinding="{Binding Nickname}" />
							 | 
						||
| 
								 | 
							
								                    <GridViewColumn Width="305"
							 | 
						||
| 
								 | 
							
								                        DisplayMemberBinding="{Binding UserName}"
							 | 
						||
| 
								 | 
							
								                        Header="账号"/>
							 | 
						||
| 
								 | 
							
								                    <GridViewColumn Width="200"
							 | 
						||
| 
								 | 
							
								                        DisplayMemberBinding="{Binding Role.RoleName}"
							 | 
						||
| 
								 | 
							
								                        Header="角色"/>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                </GridView>
							 | 
						||
| 
								 | 
							
								            </ListView.View>
							 | 
						||
| 
								 | 
							
								        </ListView>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        <pagination:Pagination Grid.Row="2"
							 | 
						||
| 
								 | 
							
								                                   CurrentPage="{Binding PageNum}"
							 | 
						||
| 
								 | 
							
								                                   PageSize="{Binding PageSize}"
							 | 
						||
| 
								 | 
							
								                                   TotalPages="{Binding TotalCount}"
							 | 
						||
| 
								 | 
							
								                                   InfoTextIsEnabel="True"
							 | 
						||
| 
								 | 
							
								                                />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    </Grid>
							 | 
						||
| 
								 | 
							
								</UserControl>
							 | 
						||
| 
								 | 
							
								
							 |