Hey folks,
I'm getting back in to some C# development (2D editor using Monogame/WPF) and must be missing something completely obvious with ListBoxes...
When I add a level to my game project, I refresh the list box displaying the project's levels like this :
myLevelList.Items.Clear();
Guid activeLevel = myEngineController.ActiveLevel;
List<Level> projectLevels = engine.Project.Levels;
foreach( Level level in projectLevels )
{
myLevelList.Items.Add( level.Name );
if( level.Id == activeLevel && activeLevel != Guid.Empty )
{
myLevelList.SelectedIndex = myLevelList.Items.Count - 1;
}
}
So here myLevelList is my ListBox instance.
While this works programmatically (the ListBox instance gets the correct 'SelectedValue', 'SelectedIndex'), the UI isn't updated; there is no blue selection box around the currently selected item.
Any idea what else I need to do here?