Often I find myself writing code like this:
if (Session != null)
{
Session.KillAllProcesses();
Session.AllUnitsReady
My preference is to manage lifetime with a disposable. Rx includes some disposable extensions which let you do the following:
Disposable.Create(() => {
this.ViewModel.Selection.CollectionChanged -= SelectionChanged;
})
If you then store this in some kind of GroupDisposable thats lifetimed to the correct scope then you are all set.
If you aren't managing lifetime with disposables and scopes then definitely worth investigating as its becoming a very pervasive pattern in .net.