private void ReturnSubModuleAnimation(SpriteAnimation.SpriteAnimationCallback callback) { Storyboard sb = new Storyboard(); this.PanelSprite.Descriptor.ToX = 1761; SpriteAnimation.XMoveToAnimation(this.PanelSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1761, -0.8, providedStory: sb); this.WhitePanelSprite.Descriptor.ToX = 1920 + 1920 / 2; SpriteAnimation.XMoveToAnimation(this.WhitePanelSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1920 + 1920 / 2, -0.8, providedStory: sb); this.ButtonGroupSprite.Descriptor.ToOpacity = 1; this.ButtonGroupSprite.Descriptor.ToY = 1080 / 2; SpriteAnimation.OpacityToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1, 0, providedStory: sb); SpriteAnimation.YMoveToAnimation(this.ButtonGroupSprite, new Duration(TimeSpan.FromMilliseconds(200)), 1080 / 2, -0.8, (_, __) => { this.ButtonGroupSprite.DisplayBinding.IsHitTestVisible = true; }, providedStory: sb); this.CommonBackButtonSprite.DisplayBinding.IsHitTestVisible = false; this.CommonBackButtonSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.CommonBackButtonSprite, new Duration(TimeSpan.FromMilliseconds(200)), 0, 0, providedStory: sb); this.EpisodeHintSprite.Descriptor.ToOpacity = 1; SpriteAnimation.OpacityToAnimation(this.EpisodeHintSprite, new Duration(TimeSpan.FromMilliseconds(300)), 1, 0, providedStory: sb); sb.Completed += (_, __) => callback?.Invoke(_, __); sb.Begin(); }
private void HandleBackward(SpriteAnimation.SpriteAnimationCallback callback) { switch (this.currentStaging) { case "backlog": this.BacklogStackSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.BacklogStackSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0, cb: (_, __) => { this.StackPanel_Backlog_MainStack.Children.Clear(); }); break; case "save": case "load": var shouldExit = ((LHSaveLoadPage)this.Frame_SaveLoad.Content).WhenLeave(); if (!shouldExit) { return; } this.SaveLoadPageSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.SaveLoadPageSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0, cb: (_, __) => { this.SaveLoadPageSprite.DisplayBinding.Visibility = Visibility.Hidden; }); break; case "settings": ((LHSettingsPage)this.Frame_Settings.Content).WhenLeave(); this.SettingsPageSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.SettingsPageSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0, cb: (_, __) => { this.SettingsPageSprite.DisplayBinding.Visibility = Visibility.Hidden; }); break; } this.SubTitleSprite.Descriptor.ToOpacity = 0; SpriteAnimation.OpacityToAnimation(this.SubTitleSprite, new Duration(TimeSpan.FromMilliseconds(100)), 0, 0); this.ReturnSubModuleAnimation(callback); }