private void CreateVM_Deactivated(object sender, DeactivationEventArgs e) { _createVM.Deactivated -= CreateVM_Deactivated; if (_createVM.Result) { RefreshLocalWallpaper(); } _createVM = null; }
public void CreateWallpaper() { if (_createVM != null) { _createVM.ActiveUI(); return; } var windowManager = IoC.Get <IWindowManager>(); _createVM = IoC.Get <CreateWallpaperViewModel>(); _createVM.Deactivated += CreateVM_Deactivated; dynamic windowSettings = new ExpandoObject(); windowSettings.WindowStartupLocation = WindowStartupLocation.CenterOwner; windowSettings.Owner = GetView(); windowManager.ShowWindow(_createVM, null, windowSettings); }