Пример #1
0
        void SelectItem(object item)
        {
            int   position = TemplatedItemsView.TemplatedItems.GetGlobalIndexOfItem(item);
            AView view     = null;

            if (position != -1)
            {
                view = _realListView.GetChildAt(position + 1 - _realListView.FirstVisiblePosition);
            }

            Select(position, view);
        }
Пример #2
0
        private async void _control_Scroll(object sender, AbsListView.ScrollEventArgs e)
        {
            var c       = _control.GetChildAt(0);
            var scrolly = -c.Top + _control.FirstVisiblePosition * c.Height;

            if (scrolly < 20)
            {
                await Task.Delay(250);
            }

            // TODO: When scrolls to down we should animate toolbar to top together with layout
            // NavigationPage.SetHasNavigationBar(page.CurrentPage, !(scrolly > 20));
        }
Пример #3
0
        void DisposeCells()
        {
            var cellCount = _realListView?.ChildCount ?? 0;

            for (int i = 0; i < cellCount; i++)
            {
                var layout = _realListView.GetChildAt(i) as ConditionalFocusLayout;

                // Headers and footers will be skipped. They are disposed elsewhere.
                if (layout == null || layout.IsDisposed())
                {
                    continue;
                }

                var renderedView = layout?.GetChildAt(0);

                var element = (renderedView as INativeElementView)?.Element;

                var view = (element as ViewCell)?.View;

                if (view != null)
                {
                    var renderer = Platform.GetRenderer(view);

                    if (renderer == renderedView)
                    {
                        element.ClearValue(Platform.RendererProperty);
                    }

                    renderer?.Dispose();
                    renderer = null;
                }

                renderedView?.Dispose();
                renderedView = null;
            }
        }