When AvalonDock is bound (__AnchorablesSource__) to an __ObservableCollection__, changing this collection (Clearing it, specifically) raises a __NullPointerException__.
Example-Project attached.
Steps to reproduce (in the Example-Project):
- Start project
- Directly press button at the bottom of the window. (do not move / click the panels)
This works flawlessly with 2.9.0
Comments: ** Comment from web user: BoucherS **
Hi,
This is already fixed in v3.1.
In the meantime, you can do the following changes :
1) In file Xceed.Wpf.AvalonDock/Controls/LayoutItems.cs,
Add the following method :
```
internal bool IsViewExists()
{
return ( _view != null );
}
```
2) In file Xceed.Wpf.AvalonDock/DockingManager.cs
In method "RemoveViewFromLogicalChild"
Replace its content with :
```
if( layoutContent == null )
return;
var layoutItem = this.GetLayoutItemFromModel( layoutContent );
if( layoutItem != null )
{
if( layoutItem.IsViewExists() )
{
this.InternalRemoveLogicalChild( layoutItem.View );
}
}
```
――――
_Get more controls, features, updates and technical support with [Xceed Toolkit Plus for WPF](https://wpftoolkit.codeplex.com/wikipage?title=Compare%20Editions)_