Browse Source

Fix failing test.

And remove empty method.
pull/2489/head
Steven Kirk 7 years ago
parent
commit
e63fc96c84
  1. 5
      src/Avalonia.Controls/Presenters/CarouselPresenter.cs
  2. 11
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

5
src/Avalonia.Controls/Presenters/CarouselPresenter.cs

@ -94,11 +94,6 @@ namespace Avalonia.Controls.Presenters
set { SetValue(PageTransitionProperty, value); }
}
protected override void PanelCreated(IPanel panel)
{
base.PanelCreated(panel);
}
/// <inheritdoc/>
protected override void ItemsChanged(NotifyCollectionChangedEventArgs e)
{

11
src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

@ -325,14 +325,19 @@ namespace Avalonia.Controls.Primitives
if (_updateCount == 0)
{
var newIndex = -1;
if (SelectedIndex != -1)
{
SelectedIndex = IndexOf((IEnumerable)e.NewValue, SelectedItem);
newIndex = IndexOf((IEnumerable)e.NewValue, SelectedItem);
}
else if (AlwaysSelected && Items != null && Items.Cast<object>().Any())
if (AlwaysSelected && Items != null && Items.Cast<object>().Any())
{
SelectedIndex = 0;
newIndex = 0;
}
SelectedIndex = newIndex;
}
}

Loading…
Cancel
Save