protected override void OnLoaded() { Instance = this; this.DataContext = this.viewModel = new ViewModelWindowPowerThresholdsConfiguration( this.worldObject, callbackSave: () => this.CloseWindow(DialogResult.OK), callbackCancel: () => this.CloseWindow(DialogResult.Cancel)); }
protected override void OnUnloaded() { if (ReferenceEquals(this, Instance)) { Instance = null; } this.DataContext = null; this.viewModel.Dispose(); this.viewModel = null; }