protected virtual void UnLoad() { foreach (var kvp in _mementoHashtable) { if (kvp.Key.Contains(COLLECTION_INDICATOR)) { _mementoService.UnregisterCollection((INotifyCollectionChanged)kvp.Value); } else { _mementoService.UnregisterObject((INotifyPropertyChanged)kvp.Value); } } _mementoHashtable.Clear(); }
/// <summary> /// Called when the view model has just been closed. /// <para/> /// This method also raises the <see cref="E:Catel.MVVM.ViewModelBase.Closed"/> event. /// </summary> /// <param name="result">The result to pass to the view. This will, for example, be used as <c>DialogResult</c>.</param> protected override void OnClosed(bool?result) { _mementoService.UnregisterCollection(PersonCollection); base.OnClosed(result); }
/// <summary> /// Called when the view model has just been closed. /// <para/> /// This method also raises the <see cref="E:Catel.MVVM.ViewModelBase.ClosedAsync"/> event. /// </summary> /// <param name="result">The result to pass to the view. This will, for example, be used as <c>DialogResult</c>.</param> protected override async Task OnClosedAsync(bool?result) { _mementoService.UnregisterCollection(PersonCollection); await base.OnClosedAsync(result); }