I've got a memory leak with Prism's InteractionRequestTrigger and AvalonDock's deserialize operation.
When I do deserialize, DockingManager's Layout property is replaced and views in old one still hold the Raised event of InteractionRequest on relied view model by InteractionRequestTrigger. Hence this, defined TriggerAction is called twice or more after deserializing. Sample project shows this behavior. After deserialize, ShowDialog shows dialog multiple times.
To fix this, in my opinion, add below lines to LayoutItem.Detach method. This will unwire the Raised event between view and view model.
//If there is a related view, set that's DataContext to null
if(this._view != null)
this._view.DataContext = null;
If there are another good solutions, please let me know.
Thanks.
When I do deserialize, DockingManager's Layout property is replaced and views in old one still hold the Raised event of InteractionRequest on relied view model by InteractionRequestTrigger. Hence this, defined TriggerAction is called twice or more after deserializing. Sample project shows this behavior. After deserialize, ShowDialog shows dialog multiple times.
To fix this, in my opinion, add below lines to LayoutItem.Detach method. This will unwire the Raised event between view and view model.
//If there is a related view, set that's DataContext to null
if(this._view != null)
this._view.DataContext = null;
If there are another good solutions, please let me know.
Thanks.