Esempio n. 1
0
 public static void UpdateItemsLayout(this TCollectionView platformView, StructuredItemsView view)
 {
     if (view.ItemsLayout != null)
     {
         var itemSizingStrategy = view.ItemSizingStrategy.ToPlatform();
         if (view.ItemsLayout is GridItemsLayout grid)
         {
             var orientation           = grid.Orientation == ItemsLayoutOrientation.Horizontal;
             var verticalItemSpacing   = DPExtensions.ConvertToScaledPixel(grid.VerticalItemSpacing);
             var horizontalItemSpacing = DPExtensions.ConvertToScaledPixel(grid.HorizontalItemSpacing);
             platformView.LayoutManager = new GridLayoutManager(orientation, grid.Span, itemSizingStrategy, verticalItemSpacing, horizontalItemSpacing);
         }
         else if (view.ItemsLayout is LinearItemsLayout linear)
         {
             var orientation = linear.Orientation == ItemsLayoutOrientation.Horizontal;
             var itemSpacing = DPExtensions.ConvertToScaledPixel(linear.ItemSpacing);
             platformView.LayoutManager = new LinearLayoutManager(orientation, itemSizingStrategy, itemSpacing);
         }
         else
         {
             platformView.LayoutManager = new LinearLayoutManager(false);
         }
         platformView.SnapPointsType = (view.ItemsLayout as ItemsLayout).SnapPointsType.ToPlatform();
         platformView.SelectionMode  = (view as SelectableItemsView).SelectionMode.ToPlatform();
     }
 }
Esempio n. 2
0
 void UpdateFooterLayout(double widthConstraint, double heightConstraint)
 {
     if (_footerView != null)
     {
         var requestSize = _footerView.Measure(widthConstraint, heightConstraint);
         if (_navigationView.Footer != null)
         {
             _navigationView.Footer.MinimumHeight = TDPExtensions.ConvertToScaledPixel(requestSize.Request.Height);
         }
     }
 }