In my WPF application, I have a simple listbox:
<ListBox x:Name="lbUtilities">
<ListBoxItem Tag="2" Content="One" IsSelected="True" />
<ListBoxItem Tag="5" Content="Two" />
</ListBox>
The problem is that when the ListBox appears first time, the selected item ("One") is not highlighted. If I click on any item, it gets highlighted. How could I have the selected by default item to be highlighted to the system color?
Thanks.
It is selected but you need a hightlight for not focused
I had a similar problem with the listview control where the selected item was highlighted only from user clicking on it, not from code behind such as:
I saw that the item was effectively selected but not highlighted as defined in my ItemContainerStyle. Then i tried something else:
then it started to work just as expected.