protected override void OnUnloaded() { this.DataContext = null; this.viewModel?.Dispose(); this.viewModel = null; if (this.isCurrentClientCharacter) { ClientUpdateHelper.UpdateCallback -= this.Update; } }
protected override void OnLoaded() { this.DataContext = this.viewModel = new ViewModelCharacterOverlayControl(this.character, () => this.RefreshVisualState(useTransitions: true)); // switch instantly to the initial state // (e.g. a creature enters the scope during the night, there should be no visible->collapsed animation) this.RefreshVisualState(useTransitions: false); }
protected override void OnUnloaded() { this.DataContext = null; this.viewModel?.Dispose(); this.viewModel = null; }
protected override void OnLoaded() { this.DataContext = this.viewModel = new ViewModelCharacterOverlayControl(this.character); }