![](/img/trans.png)
[英]Silverlight toolkit. StackedColumnSeries add label over column
[英]Silverlight toolkit. Treeview drag and drop functionality
拖放不適用於此快照:
<toolkitDrag:TreeViewDragDropTarget AllowDrop="true" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BindingValidationError="TreeViewDragDropTarget_BindingValidationError" ItemDroppedOnSource="TreeViewDragDropTarget_ItemDroppedOnSource" ItemDroppedOnTarget="TreeViewDragDropTarget_ItemDroppedOnTarget" ItemDragStarting="TreeViewDragDropTarget_ItemDragStarting">
<controls:TreeView Name="treeView">
<controls:TreeView.ItemTemplate>
<toolkit:HierarchicalDataTemplate ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=FullDescription}" />
</StackPanel>
</toolkit:HierarchicalDataTemplate>
</controls:TreeView.ItemTemplate>
</controls:TreeView>
</toolkitDrag:TreeViewDragDropTarget>
公共組織樹()
{
InitializeComponent();
var organizationNodes=new List<OrganizationNode>();
var firstNode = new OrganizationNode() { FullDescription = "Description" };
firstNode.Children.Add(new OrganizationNode() { FullDescription = "desc1" });
firstNode.Children.Add(new OrganizationNode() { FullDescription = "desc2" });
firstNode.Children.Add(new OrganizationNode() { FullDescription = "desc3" });
firstNode.Children.Add(new OrganizationNode() { FullDescription = "desc4" });
organizationNodes.Add(firstNode);
this.treeView.ItemsSource = organizationNodes;
}
假設開箱即用。 任何想法可能是錯誤的?
我已將 List 更改為 ObservableCollection 並且現在拖放工作正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.