If I create a custom factory for the control and I override the RemovePane method, I get null pointers when the method is called.
Has somebody any idea of what I am doing wrong? I can provide a sample if needed.
Thanks!
4 Answers, 1 is accepted
Have you checked our SDK example which demonstrates how to achieve this functionality ( here is the link: https://github.com/telerik/xaml-sdk/tree/master/Docking/PaneGroupItemsSource)? Can you reproduce the described issue with it? Any additional information you could send us on your approach will be helpful.
Looking forward to your reply.
Regards,
Yana
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
the example you pointed out is slightly different than what's shown in the documentation, which instructs to bind panels directly to the RadDocking:
<telerik:RadDocking PanesSource="{Binding Panes}">
<telerik:RadDocking.DockingPanesFactory>
<telerik:DockingPanesFactory/>
</telerik:RadDocking.DockingPanesFactory>
</telerik:RadDocking>
At http://www.telerik.com/help/wpf/raddocking-features-panes-panesource.html
Would it be possible to use this approach, or is it compulsory to do it the way the example shows?
Thanks!
Indeed, you should use the approach explained in the article. I am sorry for my confusion.
As to the question - I'm pasting the reply from the support ticket on the same matter:
You are receiving this error as in the RemovePane method inside DockingPanesFactory the pane is actually already removed (as the Panes list is syncronized with the CustomRadPaneViewModels list). What we can suggest is to add/remove items from the Panes collection directly and update the ViewModels collection accordingly. Also note that currently the getter of the Panes collection will generate a new list each time it is called.
Regards,
Yana
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
I had the same Problem you described. I bound RadDocking PanesSource Property to an ObservableCollection and everything workd fine until I removed one Element from the backing collection: DockingPanesFactory.RemovePane() was called with the RadPane parmater set to null which in turn emitted an InvalidArgumentException in the default implementation.
It turned out that I had forgotten to set the RadPane.DataContext Property in DockingPanesfactory.CreatePaneForItem. That caused DockingPanesFactory.GetPaneForItem() always to return null which was then fed into the DockingPanesFactory.RemovePane() call.