Пример #1
0
        private void EnsureFSItemVisible(FilesystemItem fsItem)
        {
            float min    = 0;
            float offset = 0;
            var   pos    = fsItem.CalcPositionInSpaceOf(ScrollView);

            if (ScrollView.Direction == ScrollDirection.Vertical)
            {
                min    = pos.Y;
                offset = min + fsItem.Height - ScrollView.Height;
            }
            else if (ScrollView.Direction == ScrollDirection.Horizontal)
            {
                min    = pos.X;
                offset = min + fsItem.Width - ScrollView.Width;
            }
            EnsureRangeVisible(min, offset);
        }
Пример #2
0
        private void EnsureFSItemVisible(FilesystemItem fsItem)
        {
            var y = fsItem.CalcPositionInSpaceOf(scrollView).Y;

            EnsureRangeVisible(y, y + fsItem.Height);
        }