protected override void OnLoaded() { this.layoutRoot.DataContext = this.viewModel = new ViewModelRatesEditorControl( () => this.AnyRateChanged?.Invoke()); if (this.lastPreset is not null) { this.ApplyPreset(this.lastPreset); } }
protected override void OnUnloaded() { this.layoutRoot.DataContext = null; this.viewModel.Dispose(); this.viewModel = null; }