WPF ListView Header添加CheckBox

效果如图
20210420_214049
关键代码

<ListView>
    <ListView.View>
        <GridView>
            <GridViewColumn>
                <GridViewColumn.HeaderTemplate>
                    <DataTemplate>
                        <CheckBox/>
                    </DataTemplate>
                </GridViewColumn.HeaderTemplate>
            </GridViewColumn>
        </GridView>
    </ListView.View>
</ListView>

示例代码

ListViewWithCheckBox

参考资料

WPF ListView Header Checkbox and MVVM Command

posted @ 2021-04-20 21:51  Lulus  阅读(734)  评论(0编辑  收藏  举报