【文件属性】:
文件名称:wpf treeview checkbox
文件大小:103KB
文件格式:RAR
更新时间:2021-05-24 07:41:26
wpf treeview checkbox
支持checkbox
核心代码
void SetIsChecked(bool? value, bool updateChildren, bool updateParent)
{
if (value == _isChecked)
return;
_isChecked = value;
if (updateChildren && _isChecked.HasValue)
{
foreach (TreeItem child in children)
{
child.SetIsChecked(_isChecked, true, false);
}
}
if (updateParent && parent != null)
{
parent.VerifyCheckState();
}
this.OnPropertyChanged("IsChecked");
}
【文件预览】:
WPFTreeviewExamples.sln
WPFTreeviewExamples
----SimpleTree.xaml(1KB)
----MyTree.xaml.cs(6KB)
----WPFTreeviewExamples.csproj(7KB)
----WPFTreeviewExamples.csproj.user(452B)
----App.xaml.cs(315B)
----Window1.xaml(686B)
----SimpleTree.xaml.cs(2KB)
----PngTree.xaml.cs(3KB)
----Window1.xaml.cs(1KB)
----TreeItem.cs(3KB)
----Properties()
--------Settings.settings(201B)
--------Resources.Designer.cs(3KB)
--------AssemblyInfo.cs(2KB)
--------Settings.Designer.cs(1KB)
--------Resources.resx(5KB)
----App.xaml(300B)
----MyTree.xaml(2KB)
----image()
--------Provine.png(874B)
--------City.png(946B)
--------root.png(977B)
----obj()
--------Debug()
----PngTree.xaml(1KB)
----bin()
--------Debug()
--------Release()