Closed
Description
Description
I define a DataTrigger on a ContentView for a ItemTemplate on a CollectionView.
My goal is to change the background color on the row where the SelectedItem is matching the value.
contentView.Triggers.Add(new DataTrigger(typeof(ContentView))
{
Binding = new Binding("."),
Value = SelectedItem,
Setters =
{
new Setter
{
Property = VisualElement.BackgroundColorProperty,
Value = ResourceHelper.GetThemeColor("PrimaryDark", "Primary")
}
}
});
When I select a value like United States, I open again the picker I can see United States is selected but if I scroll, many row will have a background. It's should not be possible with my Triggers.
If I scroll down very fast and I scroll up, I have more background appearing on my rows coming from nowhere.
Steps to Reproduce
- Clone the project and restore it.
- Uncomment the line 76-88 in CollectionPopup.xaml.cs file
- Run the application on Android.
- Go on the page 'Picker with popup demo'.
- Open the Country picker and select United States.
- Open again the Country picker, the United State is selected, but every items, matching the height size of the device is selected.
Link to public reproduction project repository
https://github.com/StephanArnas/Blog_MAUI_ComponentLibrary/tree/articles/part_4
Version with bug
8.0.82 SR8.2
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
Android 14, iOS 15
Did you find any workaround?
No workaround for now, I desactivate the trigger to not confuse my users.
Relevant log output
No response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment