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

            this.DataContext = null;
            this.viewModel.Dispose();
            this.viewModel = null;
        }