Ejemplo n.º 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));
            }
        }
Ejemplo n.º 2
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));
            }
        }