void ScrollToPosition(int position, bool animated) { if (position == _position) { return; } if (animated) { _scrollToTarget = position; } _controller.ScrollToPosition(position, animated); }
void ScrollToPosition(int position, bool animated) { /* * Remove condition: * if (position == _position) * return; * * I wasn't able to determine how, but there was a race condition where _position was set prior to OnElementPropertyChanged * * This was intermittently causing the CarouselView to not call ScrollToPosition * * Removing the condition had no ill effects on the control */ if (animated) { _scrollToTarget = position; } _controller.ScrollToPosition(position, animated); }