/// <summary> /// Hides the popup on tapping outside of the popup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void LightDismissArea_Tapped(object sender, TappedRoutedEventArgs e) { var p = e.GetPosition(_popup); if (LightDismissEnabled) { if (p.Y < 0 || p.X < 0 || (!double.IsNaN(PopupWidth) && p.X > PopupWidth)) { await PopupPresenterHost.HideSlideupPopupAsync(this); } } }
/// <summary> /// This event will complete the manipulation of the user. This will completes hide or reverts the slidedown /// </summary> /// <param name="sender">Not important</param> /// <param name="e">Not important</param> private async void _popup_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) { if (outofrangeslide) { return; } var Host = (FrameworkElement)this.Parent; if (e.Cumulative.Translation.Y > 50) { (HidePopupStoryboard.Children[0] as DoubleAnimation).To = Host.ActualHeight; (HidePopupStoryboard.Children[1] as DoubleAnimation).To = 0; await HidePopupStoryboard.BeginAsync(); await PopupPresenterHost.HideSlideupPopupAsync(this); } else { await ShowPopupStoryboard.BeginAsync(); } }