Exemple #1
0
        public new Task ScrollToAsync(Element element, ScrollToPosition position, bool animated)
        {
            if (!Enum.IsDefined(typeof(ScrollToPosition), position))
            {
                throw new ArgumentException("position is not a valid ScrollToPosition", "position");
            }

            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            if (!CheckElementBelongsToScrollViewer(element))
            {
                throw new ArgumentException("element does not belong to this ScrollView", "element");
            }

            var args = new ScrollToRequestedEventArgs(element, position, animated);

            OnScrollToRequested(args);
            return(_scrollCompletionSource.Task);
        }