WPF ListView GridViewColumn DisplayMemeberBinding SystemDateTime sys:clr-namespace:System;assembly=mscorlib

<Window x:Class="WpfApp395.MainWindow"
        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:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:local="clr-namespace:WpfApp395"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <ListView>
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Date" Width="100"/>
                    <GridViewColumn Header="Day of Week"
                                    DisplayMemberBinding="{Binding DayOfWeek}"
                                    Width="100"/>
                    <GridViewColumn Header="Year" 
                                    DisplayMemberBinding="{Binding Year}"
                                    Width="100"/>
                    <GridViewColumn Header="Month"
                                    DisplayMemberBinding="{Binding Month}"
                                    Width="100"/>
                    <GridViewColumn Header="Day"
                                    DisplayMemberBinding="{Binding Day}"
                                    Width="100"/>
                </GridView>
            </ListView.View>
            <sys:DateTime>1/1/2012</sys:DateTime>
            <sys:DateTime>1/2/2012</sys:DateTime>
            <sys:DateTime>1/3/2012</sys:DateTime>
            <sys:DateTime>9/21/2024</sys:DateTime>
            <sys:DateTime>9/21/2025</sys:DateTime>
        </ListView>
    </Grid>
</Window>

 

 

 

posted @ 2024-09-21 22:00  FredGrit  阅读(2)  评论(0编辑  收藏  举报