void HomePage_Unloaded(object sender, RoutedEventArgs e) { var viewModel = DataContext as HomePageViewModel; if (viewModel != null) { viewModel.DisableActivePresentation(); } _presentationManager.RemoveResourceDictionary(_dynamicResourceDictionary); }
public void Unload() { foreach (var resource in _globalResources) { _presentationManager.RemoveResourceDictionary(resource); } foreach (var resource in _globalResources.OfType <IDisposable>()) { resource.Dispose(); } _globalResources.Clear(); }