mvvmcross - Spinner SelectedItem and ItemsSource -
i have deserialized spinner object, , loaded in view model (the property bound selecteditem). mvx keeps saying not find spinner object, spinner selecteditem cannot null.
i realised deserialized spinner object not part of itemssource, since deserialized json. therefore searched corresponding item in itemssource , replaced selecteditem correct object. works.
is there cleaner way of doing this? perhaps should implement iequatable in object. please advise.
the deserialized spinner object not part of itemssource, since deserialized json. therefore searched corresponding item in itemssource , replaced selecteditem correct object.
i'm not entirely sure asking.
however, helps: there example of using equals
provide object matching in spinner in https://github.com/mvvmcross/mvvmcross-tutorials/blob/master/apiexamples/apiexamples.core/viewmodels/viewmodels.cs#l105
Comments
Post a Comment