本文介绍了文件夹树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用控件创建文件夹树.我这样做:
I want to create folder tree with item Control. I do this:
<StackPanel FlowDirection="RightToLeft" Orientation="Vertical">
<ItemsControl Name="b">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<my:ucMyAccordion x:Name="myAccordion" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
myAccordion有文件夹的名称.
myAccordionhas the name of folder.
我有添加新文件夹的按钮,他的点击事件是:
I have button to add new folder, his click event do:
ItemControl itemControl = new ItemControl(itemDoch.Count, strConName,null);
itemDoch.Add(itemControl);
但是,计数增加了,我在屏幕上仅看到我添加的firs文件夹.我该怎么办?
but , the count is up and I see on screen only the firs folder I add. what am I need to do??
推荐答案
请参阅此文档
http://msdn.microsoft.com/en-us/library /system.windows.controls.itemscontrol.aspx
任何其他问题,请随时让我知道.
Any further questions please feel free to let me know.
这篇关于文件夹树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!