WinRole.xaml 2.49 KB
<Window
     x:Class="HHECS.View.UserOperation.WinRole"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:HHECS.View.UserOperation"
        mc:Ignorable="d"
        Title="角色" Height="450" Width="800" Loaded="Window_Loaded" ResizeMode="NoResize">
    <DockPanel>
        <ToolBar x:Name="TBMain" DockPanel.Dock="Top">
            <Button Tag="role:add" x:Name="BtnNew" Click="BtnNew_Click">新增</Button>
            <Button Tag="role:edit" x:Name="BtnEdit" Click="BtnEdit_Click">编辑</Button>
            <Button Tag="role:delete" x:Name="BtnDelete" Click="BtnDelete_Click">删除</Button>
            <Button Tag="role:update" x:Name="BtnUpdate" Click="BtnUpdate_Click">刷新</Button>
        </ToolBar>
        <Grid>
            <DataGrid x:Name="DatagridMain" HorizontalAlignment="Left"  VerticalAlignment="Top" AlternationCount="2">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Id" Binding="{Binding Id}"/>
                    <DataGridTextColumn Header="角色名" Binding="{Binding RoleName}"/>
                    <DataGridTextColumn Header="备注" Binding="{Binding Remark}"/>
                    <DataGridTextColumn Header="创建时间" Binding="{Binding Created}"/>
                    <DataGridTextColumn Header="创建人" Binding="{Binding CreatedBy}"/>
                    <DataGridTextColumn Header="更新时间" Binding="{Binding Updated}"/>
                    <DataGridTextColumn Header="更新人" Binding="{Binding UpdatedBy}"/>
                </DataGrid.Columns>

                <DataGrid.RowStyle>
                    <Style TargetType="{x:Type DataGridRow}">
                        <Style.Triggers>
                            <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                                <Setter Property="Background" Value="#ccffcc" />
                            </Trigger>
                            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                                <Setter Property="Background" Value="#FFF2F2F2" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>

            </DataGrid>
        </Grid>
    </DockPanel>
</Window>