private void CloseWindow() { this.storyboardFadeIn?.Stop(this); AnimationHelper.CreateStoryboard( this, durationSeconds: 0.667, from: this.Opacity, to: 0, propertyName: OpacityProperty.Name, onCompleted: this.BackgroundFadeOutCompleted) .Begin(this); if (instance == this) { instance = null; } }
protected override void WindowClosed() { base.WindowClosed(); this.storyboardFadeIn?.Stop(this.backgroundControl); AnimationHelper.CreateStoryboard( this.backgroundControl, durationSeconds: 0.667, from: this.backgroundControl.Opacity, to: 0, propertyName: OpacityProperty.Name, onCompleted: this.BackgroundFadeOutCompleted) .Begin(this.backgroundControl); if (instance == this) { instance = null; } }
public static void EnsureOpened() { if (!isClosed) { return; } isClosed = false; var windowRespawn = new WindowRespawn(); instance = windowRespawn; Api.Client.UI.LayoutRootChildren.Add(instance); var loadingSplashScreenState = LoadingSplashScreenManager.Instance.CurrentState; var delay = loadingSplashScreenState == LoadingSplashScreenState.Shown || loadingSplashScreenState == LoadingSplashScreenState.Showing ? 0 : 2; ClientComponentTimersManager.AddAction( delaySeconds: delay, action: () => { windowRespawn.Window.IsCached = false; if (isClosed) { if (ReferenceEquals(instance, windowRespawn)) { instance = null; Api.Client.UI.LayoutRootChildren.Remove(instance); } return; } instance.Window.Open(); }); }