Esempio n. 1
0
        public void MoveListBy(int count)
        {
            int height = _rowHeight.Compute(Bounds.Height) + _separatorHeight.Compute(Bounds.Height);

            _scrollingService.ScrollPositionY += height * count;
            _scrollingService.Process();
        }
Esempio n. 2
0
        public void Show(object item)
        {
            UiView view;

            if (_bindingToElement.TryGetValue(item, out view))
            {
                if (_vertical)
                {
                    if (view.Bounds.Bottom > Bounds.Height)
                    {
                        _scrollingService.ScrollPositionY += view.Bounds.Bottom - Bounds.Height;
                    }

                    if (view.Bounds.Top < 0)
                    {
                        _scrollingService.ScrollPositionY += view.Bounds.Top;
                    }

                    _scrollingService.Process();
                }
                else
                {
                    if (view.Bounds.Right > Bounds.Width)
                    {
                        _scrollingService.ScrollPositionX += view.Bounds.Right - Bounds.Width;
                    }

                    if (view.Bounds.Left < 0)
                    {
                        _scrollingService.ScrollPositionX += view.Bounds.Left;
                    }

                    _scrollingService.Process();
                }
            }
        }
Esempio n. 3
0
        public void Show(object item, int margin = 0)
        {
            UiView view;

            if (_bindingToElement.TryGetValue(item, out view))
            {
                if (_vertical)
                {
                    Rectangle bounds = view.Bounds;

                    bounds.Y      -= margin;
                    bounds.Height += margin * 2;

                    if (bounds.Top < 0)
                    {
                        _scrollingService.ScrollPositionY += bounds.Top;
                        ShouldRecalcLayout();
                    }
                    else if (bounds.Bottom > Bounds.Height)
                    {
                        if (bounds.Height > Bounds.Height)
                        {
                            _scrollingService.ScrollPositionY += bounds.Top;
                            ShouldRecalcLayout();
                        }
                        else
                        {
                            _scrollingService.ScrollPositionY += bounds.Bottom - Bounds.Height;
                            ShouldRecalcLayout();
                        }
                    }

                    _scrollingService.Process();
                }
                else
                {
                    Rectangle bounds = view.Bounds;

                    bounds.X     -= margin;
                    bounds.Width += margin * 2;

                    if (bounds.Left < 0)
                    {
                        _scrollingService.ScrollPositionX += bounds.Left;
                        ShouldRecalcLayout();
                    }
                    else if (bounds.Right > Bounds.Width)
                    {
                        if (bounds.Width > Bounds.Width)
                        {
                            _scrollingService.ScrollPositionX += bounds.Left;
                            ShouldRecalcLayout();
                        }
                        else
                        {
                            _scrollingService.ScrollPositionX += bounds.Right - Bounds.Width;
                            ShouldRecalcLayout();
                        }
                    }

                    _scrollingService.Process();
                }
            }
        }