From 96b68241c8222fb47bb64ab13972b78a8f364487 Mon Sep 17 00:00:00 2001 From: noctwolf Date: Thu, 15 Aug 2019 23:06:24 +0800 Subject: [PATCH] UpdatePageButtons --- .../HandyControl_Shared/Controls/Other/Carousel.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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));