前台xaml文件

<Window x:Class="Supplier.UserI"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Supplier"
        Title="查看用户" Height="500" Width="440" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">
        <Grid >
        <Grid.Resources>
            <local:TypeConvert x:Key="typeConvert"/>
            <DataTemplate x:Key="oprate" DataType="User">
                <StackPanel Orientation="Horizontal">
                    <Button Tag="{Binding}" Click="updateUser" Content="修改" Background="Gray" Width="40" Foreground="White"/>
                    <Button Tag="{Binding}"  Click="deleteUser" Content="删除" Background="red" Width="40" Foreground="White"/>
                </StackPanel>
            </DataTemplate>
            <!--<DataTemplate x:Key="permis" DataType="User" >
                <ComboBox x:Name="permission" SelectedIndex="{Binding Type}" >
                    <TextBlock Text="所有操作" />
                    <TextBlock Text="查看" Margin="10,0,0,0" />
                </ComboBox>
            </DataTemplate>-->
        </Grid.Resources>
            <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="100"/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Text="用户管理" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"  FontStyle="Normal" Foreground="Blue"/>
        <Button Click="addUser"   Grid.Row="0" Content="添加" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Background="SkyBlue" Width="50" Foreground="White"/>
<!--Beige-->
        <ListView x:Name="grid" Grid.Row="1" Margin="10,0,10,10">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="序号" Width="60" DisplayMemberBinding="{Binding Number}"/>
                    <GridViewColumn Header="用户名" Width="80" DisplayMemberBinding="{Binding UserName}"/>
                    <GridViewColumn Header="权限" Width="110" DisplayMemberBinding="{Binding Type,Converter={StaticResource typeConvert}}"/> 
                    <GridViewColumn Header="操作" Width="120" CellTemplate="{StaticResource oprate}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Grid Grid.Row="2">
            <Button Content="上一页" Height="23" HorizontalAlignment="Left" Margin="37,0,0,0" Name="button7" VerticalAlignment="Top" Width="65" Click="PreviousPage" />
            <Button Content="下一页" Height="23" HorizontalAlignment="Left" Margin="108,0,0,0" Name="button8" VerticalAlignment="Top" Width="59" Click="NextPage" />
            <Label Content="转到" Height="28" HorizontalAlignment="Left" Margin="173,0,0,0" Name="label6" VerticalAlignment="Top" />
            <TextBox KeyDown="textBox1_KeyDown" Height="23" HorizontalAlignment="Left" Margin="212,0,0,0" Name="textBox1" VerticalAlignment="Top" Width="53" />
            <Button Content="GO" Height="23" HorizontalAlignment="Left" Margin="298,0,0,0" Name="button9" VerticalAlignment="Top" Width="96" Click="JumpPage" />
            <Label Content="" Height="28" HorizontalAlignment="Left" Margin="269,0,0,0" Name="label7" VerticalAlignment="Top" />
            <Label Height="28" HorizontalAlignment="Left" Margin="120,40,0,0" Name="label8" VerticalAlignment="Top" Content="【第" />
            <Label Content="1" Height="28" HorizontalAlignment="Left" Margin="157,40,0,0" Name="label1" VerticalAlignment="Top" />
            <Label Content="页】" Height="28" HorizontalAlignment="Left" Margin="176,40,0,0" Name="label10" VerticalAlignment="Top" />
            <Label Content="【共" Height="28" HorizontalAlignment="Left" Margin="242,40,0,0" Name="label11" VerticalAlignment="Top" />
            <Label Content="1" Height="28" HorizontalAlignment="Left" Margin="280,40,0,0" Name="label2" VerticalAlignment="Top" />
            <Label Content="页】" Height="28" HorizontalAlignment="Left" Margin="298,40,0,0" Name="label13" VerticalAlignment="Top" />
        </Grid>

    </Grid>
</Window>
View Code

相关文章:

  • 2021-12-13
  • 2022-01-16
  • 2022-02-09
  • 2021-11-29
  • 2022-12-23
  • 2021-11-07
  • 2021-09-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
  • 2021-10-07
  • 2022-12-23
  • 2021-06-05
相关资源
相似解决方案