AvalonDock+Prism: problem with closing first view in Document pane

Aug 16, 2013 at 6:35 PM
Hi All,
i'm using the Region adapters introduced by adospace at this thread and it works fine but in one case : when multiple views opend and i try to close the first one from the left (the first one opend), when i activate it and close it i get this exception "The region does not contain the specified view." from this method in DockingManagerDocumentsSourceSyncBehavior class :
 private void ManagerActiveContentChanged(object sender, EventArgs e)
        {
            try
            {
                this._updatingActiveViewsInManagerActiveContentChanged = true;

                if (_dockingManager == sender)
                {
                    object activeContent = _dockingManager.ActiveContent;
                    foreach (var item in this.Region.ActiveViews.Where(it => it != activeContent))
                    {
                        this.Region.Deactivate(item);
                    }


                    if (this.Region.Views.Contains(activeContent) && !this.Region.ActiveViews.Contains(activeContent))
                    {
                        this.Region.Activate(activeContent);
                    }
                }
            }
            finally
            {
                this._updatingActiveViewsInManagerActiveContentChanged = false;
            }
        }
at statement [ this.Region.Deactivate(item);]
but if i closed te same view after closing all the views to the right of it no problem happen, also if i closed it w/o activiating it first no problem happen
please advice. thanks