예제 #1
0
        protected override _View ResolveInternalItemsPanel(_View itemsPanel)
        {
            // If the items panel is a virtualizing panel, we substitute it with NativeListViewBase
            var virtualizingPanel = itemsPanel as IVirtualizingPanel;

            if (virtualizingPanel != null)
            {
                var layouter = virtualizingPanel.GetLayouter();
                layouter.ShouldApplyChildStretch = ShouldApplyChildStretch;
                PrepareNativeLayout(layouter);

                var panel = new NativeListViewBase();
                panel.XamlParent   = this;
                panel.NativeLayout = layouter;
                panel.BindToEquivalentProperty(virtualizingPanel, "Background");
                InitializeNativePanel(panel);

                return(panel);
            }
            else
            {
                // Otherwise act as a normal ItemsControl
                return(base.ResolveInternalItemsPanel(itemsPanel));
            }
        }
예제 #2
0
        partial void CleanUpNativePanel(NativeListViewBase panel)
        {
            _headerFooterSubscription.Disposable = null;
            panel.NativeLayout?.RemoveAllViews();
            panel.ViewCache?.OnUnloaded();

            panel.NativeLayout = null;
            panel.SetViewCacheExtension(null);
            panel.CurrentAdapter = null;
        }
예제 #3
0
        protected override _View ResolveInternalItemsPanel(_View itemsPanel)
        {
            // If the items panel is a virtualizing panel, we substitute it with NativeListViewBase
            var virtualizingPanel = itemsPanel as IVirtualizingPanel;

            if (virtualizingPanel != null)
            {
                var internalPanel = new NativeListViewBase();
                var layouter      = virtualizingPanel.GetLayouter();
                PrepareNativeLayout(layouter);
                internalPanel.NativeLayout = layouter;
                internalPanel.BindToEquivalentProperty(virtualizingPanel, "Background");
                return(internalPanel);
            }
            else
            {
                // Otherwise act as a normal ItemsControl
                return(base.ResolveInternalItemsPanel(itemsPanel));
            }
        }
예제 #4
0
        private void InitializeNativePanel(NativeListViewBase panel)
        {
            var source = new ListViewBaseSource(panel);

            panel.Source = source;
            panel.NativeLayout.Source = new WeakReference <ListViewBaseSource>(panel.Source);

            BindToPanel(panel, nameof(ItemsSource));

            panel.AnimateScrollIntoView = AnimateScrollIntoView;

            var disposables = new CompositeDisposable();

            Action headerFooterCallback = () => panel?.UpdateHeaderAndFooter();

            RegisterCallback(HeaderProperty, headerFooterCallback).DisposeWith(disposables);
            RegisterCallback(HeaderTemplateProperty, headerFooterCallback).DisposeWith(disposables);
            RegisterCallback(FooterProperty, headerFooterCallback).DisposeWith(disposables);
            RegisterCallback(FooterTemplateProperty, headerFooterCallback).DisposeWith(disposables);

            _callbackSubscriptions.Disposable = disposables;
        }
예제 #5
0
 public ListViewBaseSource(NativeListViewBase owner)
 {
     Owner = owner;
 }
예제 #6
0
 public BufferViewCache(NativeListViewBase owner)
 {
     _owner = owner;
 }
 public SnapPointsSnapHelper(NativeListViewBase owner)
 {
     _owner = owner;
 }
예제 #8
0
 private void InitializeNativePanel(NativeListViewBase panel)
 {
     panel.CurrentAdapter = new NativeListViewBaseAdapter {
         Owner = panel
     };
 }
예제 #9
0
 /// <summary>
 /// Bind a property on the native collection panel to its equivalent on ListViewBase
 /// </summary>
 private void BindToPanel(NativeListViewBase panel, string propertyName, BindingMode bindingMode = BindingMode.OneWay)
 {
     panel.Binding(propertyName, propertyName, this, bindingMode);
 }
예제 #10
0
 partial void CleanUpNativePanel(NativeListViewBase panel)
 {
     _callbackSubscriptions.Disposable = null;
     panel.Source?.Dispose();
     panel.Source = null;
 }
예제 #11
0
 public ScrollingViewCache(NativeListViewBase owner)
 {
     _owner = owner;
 }
예제 #12
0
 partial void CleanUpNativePanel(NativeListViewBase panel);