From f4f0f39cb7132504e96bff64a68d6641c649e1c4 Mon Sep 17 00:00:00 2001 From: tbulle Date: Fri, 31 Jan 2014 00:20:33 +0100 Subject: [PATCH] Changes to OutlineTreeView to Work With IOutlineNode --- .../Project/OutlineView/OutlineTreeView.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs index f739db7366..0225f58a47 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs @@ -13,30 +13,30 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView protected override bool CanInsert(DragTreeViewItem target, DragTreeViewItem[] items, DragTreeViewItem after, bool copy) { UpdateCustomNodes(items); - return (target.DataContext as OutlineNode).CanInsert(_customOutlineNodes, - after == null ? null : after.DataContext as OutlineNode, copy); + return (target.DataContext as IOutlineNode).CanInsert(_customOutlineNodes, + after == null ? null : after.DataContext as IOutlineNode, copy); } protected override void Insert(DragTreeViewItem target, DragTreeViewItem[] items, DragTreeViewItem after, bool copy) { UpdateCustomNodes(items); - (target.DataContext as OutlineNode).Insert(_customOutlineNodes, - after == null ? null : after.DataContext as OutlineNode, copy); + (target.DataContext as IOutlineNode).Insert(_customOutlineNodes, + after == null ? null : after.DataContext as IOutlineNode, copy); } // Need to do this through a seperate List since previously LINQ queries apparently disconnected DataContext;bug in .NET 4.0 - private List _customOutlineNodes; + private List _customOutlineNodes; void UpdateCustomNodes(IEnumerable items) { - _customOutlineNodes = new List(); + _customOutlineNodes = new List(); foreach (var item in items) - _customOutlineNodes.Add(item.DataContext as OutlineNode); + _customOutlineNodes.Add(item.DataContext as IOutlineNode); } public override bool ShouldItemBeVisible(DragTreeViewItem dragTreeViewitem) { - var node = dragTreeViewitem.DataContext as OutlineNode; + var node = dragTreeViewitem.DataContext as IOutlineNode; return string.IsNullOrEmpty(Filter) || node.Name.ToLower().Contains(Filter.ToLower()); } @@ -45,7 +45,7 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView { base.SelectOnly(item); - var node = item.DataContext as OutlineNode; + var node = item.DataContext as IOutlineNode; var surface = node.DesignItem.View.TryFindParent(); if (surface != null)