I’m having a ListBox with some TextBlocks in its ItemTemplate.
This TextBlocks are defined as this one
<TextBlock Grid.Column="1" Grid.Row="0" Text="{BindingGasStationName}"
FontSize="20" FontFamily="Segoe WP SemiLight" Margin="0,0,0,0" Padding="0"
MinHeight="27" TextTrimming="WordEllipsis"/>
The ellipsis is working as expected.
The problem is, when the user selects an item, the color of the text (and also the “…”) changes to the current system highlight color. This is what I want to have.
But when the user changes the selection, the “…” stay the highlight color during the texts are turning back into white again.
Is this a known bug or have I done something wrong?
Update
When the user selects the item with the invalid colored ellipsis again, it is getting white for a moment before the highlight color is set again…
I just reproduced the error on my end, definitely looks like a WP bug to me.
The workaround is to manually do the
ListBoxItemstyling withVisualStates. I’ve included an example here of how you can style theListBoxItemto highlight fully (including ellipsis) with the correct accent color. You set theControlTemplateof theListBoxItemand specify the foreground color for Unselected vs Selected states. Hope this helps!