protected override void OnUnloaded() { this.DataContext = null; this.viewModel?.Dispose(); this.viewModel = null; ClientUpdateHelper.UpdateCallback -= this.Update; }
protected override void OnLoaded() { VisualStateManager.GoToElementState(this.GetByName <Grid>("LayoutRoot"), "Collapsed", useTransitions: false); this.DataContext = this.viewModel = new ViewModelCharacterBossHealthbarControl(this.character); ClientUpdateHelper.UpdateCallback += this.Update; }