[iOS] CollectionView: Color for SelectedItem of CollectionView not set when SelectedItem is assigned in ViewModel #20030
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
platform/iOS 🍎
s/needs-info
Issue needs more info from the author
t/bug
Something isn't working
Description
I have a
CollectionView
with aItemTemplate
that has aVisualStateManager
to define a Color when an Item of theCollectionView
is selected:When I select one of the items in the
CollectionView
the item shows the right Color as specified in the sectionThe
CollectionView
has a Bindingfor the
SelectedItem`:The
CollectionView
is displayed in a customtoolkit:Popup
from the CommunityToolkit within a custom Picker Control. When this is opened theCustomPopupContentPage
containing this aboveCollectionView
is displayed.In the ViewModel the first item of the list should be the
SelectedItem
and is therefore assigned in the ViewModel correspondingly.On Android it looks fine and the
SelectedItem
has the right Color when opened:On iOS though the Color for a selected item is not applied:
But, when I search a Store in the above
SearchBar
an type "A" for instance, the Color is correctly applied:The
SelectedSavedStore
which is bound to theCollectionView
is anObservableProperty
and the correspondingGroupedSavedStoreItems
which is the bound Collection is also aObservableProperty
and are set in the correspondingCustomPopupViewModel
as can be found in the provided example project:The
SelectSavedStore
is set in MethodSelectSavedStoreByName
in theCustomPopupViewModel
as follows:Steps to Reproduce
SelectedSavedStore
from the ViewModel) has the right ColorSelectedSavedStore
from the ViewModel) does not have a Color set which is wrongSearchBar
of theCustomPopup
and see that the Color is now appliedLink to public reproduction project repository
SelectedItemColorNotSet_20030
Version with bug
8.0.6-nightly.9880
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 16.2
Did you find any workaround?
Unfortunately not so far :(
Relevant log output
No response
The text was updated successfully, but these errors were encountered: