Browse Source

fixed #3089 now set selecteditem/s before initialization should work properly

pull/3140/head
Andrey Kunchev 7 years ago
parent
commit
2e70be023b
  1. 12
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

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

@ -1088,9 +1088,15 @@ namespace Avalonia.Controls.Primitives
}
else
{
SelectedIndex = _updateSelectedIndex != int.MinValue ?
_updateSelectedIndex :
AlwaysSelected ? 0 : -1;
if (_updateSelectedIndex != int.MinValue)
{
SelectedIndex = _updateSelectedIndex;
}
if (AlwaysSelected && SelectedIndex == -1)
{
SelectedIndex = 0;
}
}
}
}

Loading…
Cancel
Save