private void OnActualPlacementChanged(PopupPlacements oldPlacement, PopupPlacements newPlacement) { SetContentLayoutOptions(newPlacement); // Raise placement change event ActualPlacementChanged?.Invoke(this, newPlacement); }
/// <summary> /// Set popup content horizontal options based on popup placement /// </summary> private void SetContentLayoutOptions(PopupPlacements placement) { if (placement == PopupPlacements.BottomStretch || placement == PopupPlacements.TopStretch) { _popupRootLayout.Content.HorizontalOptions = LayoutOptions.Fill; _popupRootLayout.Content.VerticalOptions = LayoutOptions.Center; } else if (placement == PopupPlacements.FullScreen) { _popupRootLayout.Content.HorizontalOptions = LayoutOptions.Fill; _popupRootLayout.Content.VerticalOptions = LayoutOptions.Fill; } else { _popupRootLayout.Content.HorizontalOptions = LayoutOptions.Center; _popupRootLayout.Content.VerticalOptions = LayoutOptions.Center; } }
protected virtual void OnActualPopupPlacementChanged(PopupPlacements newPlacement) { return; }
/// <summary> /// Is popup on right /// </summary> public static bool IsRightPlacement(PopupPlacements placement) { return(placement == PopupPlacements.RightBottom || placement == PopupPlacements.RightCenter || placement == PopupPlacements.RightTop); }
/// <summary> /// Is popup on top /// </summary> public static bool IsTopPlacement(PopupPlacements placement) { return(placement == PopupPlacements.TopCenter || placement == PopupPlacements.TopLeft || placement == PopupPlacements.TopRight); }