Exemplo n.º 1
0
 VirtualizingPanelLayout IVirtualizingPanel.GetLayouter()
 {
     if (_layout == null)
     {
         _layout = new ItemsStackPanelLayout();
         _layout.BindToEquivalentProperty(this, nameof(Orientation));
         _layout.BindToEquivalentProperty(this, nameof(AreStickyGroupHeadersEnabled));
         _layout.BindToEquivalentProperty(this, nameof(GroupHeaderPlacement));
         _layout.BindToEquivalentProperty(this, nameof(GroupPadding));
     }
     return(_layout);
 }
Exemplo n.º 2
0
        partial void PrepareNativeLayout(VirtualizingPanelLayout layouter)
        {
            layouter.XamlParent = this;
            var disposables = new CompositeDisposable();
            PropertyChangedCallback headerFooterCallback = (_, __) => layouter.UpdateHeaderAndFooter();

            this.RegisterDisposablePropertyChangedCallback(HeaderProperty, headerFooterCallback).DisposeWith(disposables);
            this.RegisterDisposablePropertyChangedCallback(FooterProperty, headerFooterCallback).DisposeWith(disposables);
            this.RegisterDisposablePropertyChangedCallback(HeaderTemplateProperty, headerFooterCallback).DisposeWith(disposables);
            this.RegisterDisposablePropertyChangedCallback(FooterTemplateProperty, headerFooterCallback).DisposeWith(disposables);
            _headerFooterSubscription.Disposable = disposables;
        }
            private int[] GetSnapToAsRemainingDistance(VirtualizingPanelLayout layout, float snapTo)
            {
                var diff = layout.GetSnapToAsRemainingDistance(snapTo);

                if (layout.ScrollOrientation == Orientation.Vertical)
                {
                    return(new[] { 0, (int)diff });
                }
                else
                {
                    return(new[] { (int)diff, 0 });
                }
            }
Exemplo n.º 4
0
        private void CreateLayoutIfNeeded()
        {
            if (_layout == null)
            {
                _layout = new ItemsStackPanelLayout();
                _layout.BindToEquivalentProperty(this, nameof(Orientation));
                _layout.BindToEquivalentProperty(this, nameof(AreStickyGroupHeadersEnabled));
                _layout.BindToEquivalentProperty(this, nameof(GroupHeaderPlacement));
                _layout.BindToEquivalentProperty(this, nameof(GroupPadding));
#if !XAMARIN_IOS
                _layout.BindToEquivalentProperty(this, nameof(CacheLength));
#endif
            }
        }
Exemplo n.º 5
0
 VirtualizingPanelLayout IVirtualizingPanel.GetLayouter()
 {
     if (_layout == null)
     {
         _layout = new ItemsWrapGridLayout();
         _layout.BindToEquivalentProperty(this, nameof(Orientation));
         _layout.BindToEquivalentProperty(this, nameof(AreStickyGroupHeadersEnabled));
         _layout.BindToEquivalentProperty(this, nameof(ItemHeight));
         _layout.BindToEquivalentProperty(this, nameof(ItemWidth));
         _layout.BindToEquivalentProperty(this, nameof(MaximumRowsOrColumns));
         _layout.BindToEquivalentProperty(this, nameof(GroupHeaderPlacement));
         _layout.BindToEquivalentProperty(this, nameof(GroupPadding));
     }
     return(_layout);
 }
Exemplo n.º 6
0
 public VirtualizingPanelGenerator(VirtualizingPanelLayout owner)
 {
     _owner = owner;
 }
Exemplo n.º 7
0
 partial void PrepareNativeLayout(VirtualizingPanelLayout layout);