I posted a thread two days ago about a problem I was having with e.Handled in a RadDocking.Close event. After looking at the code, I moved the logic to the PreviewClose event; however the result is the same. I am attempting to close all the panes in a RadPaneGroup inside the DocumentHost. I have tried...
- RadPaneGroup.HideAllPanes(), but the panes remain visible. After the call I can close all but the first pane indiviually using the close button on each tab. If I drag the last remaining pane off the tabstrip it disappears.
- Any direct manipulation of the RadPaneGroup.Items, whether a call to Clear(), Remove(pane), RemoveAt(index) causes an n "Object reference not set to an instance of an object." exception after exiting the handler with e.Handled set to true.
- at Telerik.Windows.Controls.RadPane.Close() in c:\TB\105WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1360
at Telerik.Windows.Controls.RadPane.OnIsHiddenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1186
- at Telerik.Windows.Controls.RadPane.Close() in c:\TB\105WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1360
- I tried looping through the Items and using RemoveFromParent() but that causes an "Object reference not set to an instance of an object." exception when attempting to remove the second pane.
- at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__7(UIElement item) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 176
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Linq.Enumerable.Max(IEnumerable`1 source)
at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__6(Double total, List`1 next) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 174
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at Telerik.Windows.Controls.Primitives.TabStripPanel.MeasureOverride(Size availableSize) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 171
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at Telerik.Windows.Controls.RadPane.OnDocumentHostTemplateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1223
- at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__7(UIElement item) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 176
- I tried removing all but the pane passed in the event args and leaving e.Handle false, hoping Close would take care of it, but that causes an "Object reference not set to an instance of an object." exception like the previous example.
- at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__7(UIElement item) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 176
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Linq.Enumerable.Max(IEnumerable`1 source)
at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__6(Double total, List`1 next) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 174
at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
at Telerik.Windows.Controls.Primitives.TabStripPanel.MeasureOverride(Size availableSize) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 171
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at Telerik.Windows.Controls.RadPane.OnDocumentHostTemplateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Docking\Docking\Docking\RadPane.cs:line 1223
- at Telerik.Windows.Controls.Primitives.TabStripPanel.<>c__DisplayClass14.<MeasureOverride>b__7(UIElement item) in c:\TB\105\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\TabControl\TabStripPanel.cs:line 176
All of this happens in 2012.2.620 and did not happen in 2012.2.607. Please let me know if there is a way to achieve this functionality without having to revert to using the previous version.
Thanks in advance, Steve