代碼如下
[csharp]
List<IrrlSysFun> datas;
public CWRoleRight()
{
InitializeComponent()
BLL
datas = list
LoadTree(treeView
})
}
private void LoadTree(ItemCollection itemCollection
{
var subList = datas
foreach (var item in subList)
{
TreeViewItem tv = new TreeViewItem()
StackPanel sp = new StackPanel()
CheckBox cb = new CheckBox()
cb
cb
cb
sp
tv
itemCollection
tv
LoadTree(tv
}
}
界面效果
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26454.html