UpdatePageButtons

This commit is contained in:
noctwolf committed 2019-08-15 23:06:24 +08:00
1 parent 41f2f039ce
commit 96b68241c8
1 file changed
+2 -9
@@ -213,15 +213,8 @@ namespace HandyControl.Controls
_panelPage.Children.Add(CreatePateButton()); _panelPage.Children.Add(CreatePateButton());
} }
if (index == -1) if (index == -1 && count > 0) index = 0;
{ if (index >= 0 && index < count)
if (count > 0)
{
var button = _panelPage.Children[0];
button.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, button));
}
}
else if (index >= 0 && index < count)
{ {
var button = _panelPage.Children[index]; var button = _panelPage.Children[index];
button.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, button)); button.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, button));