CollectionChanged event of the IViewsCollection

Docking/MDI for WPF Forum

Posted 12 years ago by BLANC Stéphane - Staubli Robotics Suite Product Manager, STAUBLI
Version: 12.1.0561
Avatar

I didn't catch the CollectionChanged event of the IViewsCollection when I close a view.

It should raise with the Remove action no ?

MyRegionManager.Regions["Main"].Views.CollectionChanged +=new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Views_CollectionChanged);

void Views_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)

{

// this event should be thrown with e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove

}

 

Thanks for help.

Comments (1)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Stéphane,

There is nothing in our Docking/Prism Interop at the moment that would remove your view-models from the Prism region view registrations.   Technically, when you close now, the window is still registered and can be reopened at anytime.

You can manually remove the view by attaching a handler to the DockSite.WindowClosed event and then removing the associated view-model.  You can probably do this in an attached behavior, and possibly in our DockSiteRegionBehavior if you have our Prism add-on source from our Codeplex site.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.