コード例 #1
0
ファイル: ItemsStackPanel.cs プロジェクト: propellingbits/Uno
 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);
 }
コード例 #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;
        }
コード例 #3
0
            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 });
                }
            }
コード例 #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
            }
        }
コード例 #5
0
ファイル: ItemsWrapGrid.cs プロジェクト: propellingbits/Uno
 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);
 }
コード例 #6
0
 public VirtualizingPanelGenerator(VirtualizingPanelLayout owner)
 {
     _owner = owner;
 }
コード例 #7
0
 partial void PrepareNativeLayout(VirtualizingPanelLayout layout);