diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs b/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs index 9fd38c42..3492f38b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs +++ b/src/Shared/HandyControl_Shared/Controls/Other/Carousel.cs @@ -213,15 +213,8 @@ namespace HandyControl.Controls _panelPage.Children.Add(CreatePateButton()); } - if (index == -1) - { - if (count > 0) - { - var button = _panelPage.Children[0]; - button.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, button)); - } - } - else if (index >= 0 && index < count) + if (index == -1 && count > 0) index = 0; + if (index >= 0 && index < count) { var button = _panelPage.Children[index]; button.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, button));