/// <summary> /// The start animation. /// </summary> /// <param name="target"> /// The target. /// </param> /// <returns> /// The <see cref="Storyboard"/>. /// </returns> public override Storyboard GenerateAnimation(FrameworkElement target) { var theme = new PopOutThemeAnimation(); Storyboard.SetTarget(theme, target); var storyboard = new Storyboard(); storyboard.Children.Add(theme); return(storyboard); }
public void Close() { if (_useAnimation) { var inAnimation = new PopOutThemeAnimation(); var storyboard = UIHelper.CreateStoryboard(inAnimation); Storyboard.SetTarget(inAnimation, Popup); storyboard.Completed += (_, _) => { Popup.IsOpen = false; _closing?.Invoke(_content, _content is ICompletableAppPopupContent completable ? completable.GetCompletionResult() : null); }; storyboard.Begin(); } else { Popup.IsOpen = false; _closing?.Invoke(_content, _content is ICompletableAppPopupContent completable ? completable.GetCompletionResult() : null); } }