Example #1
0
        private void OnActualPlacementChanged(PopupPlacements oldPlacement, PopupPlacements newPlacement)
        {
            SetContentLayoutOptions(newPlacement);

            // Raise placement change event
            ActualPlacementChanged?.Invoke(this, newPlacement);
        }
Example #2
0
 /// <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;
     }
 }
Example #3
0
 protected virtual void OnActualPopupPlacementChanged(PopupPlacements newPlacement)
 {
     return;
 }
Example #4
0
 /// <summary>
 /// Is popup on right
 /// </summary>
 public static bool IsRightPlacement(PopupPlacements placement)
 {
     return(placement == PopupPlacements.RightBottom || placement == PopupPlacements.RightCenter || placement == PopupPlacements.RightTop);
 }
Example #5
0
 /// <summary>
 /// Is popup on top
 /// </summary>
 public static bool IsTopPlacement(PopupPlacements placement)
 {
     return(placement == PopupPlacements.TopCenter || placement == PopupPlacements.TopLeft || placement == PopupPlacements.TopRight);
 }