question

AustinHunter-0219 avatar image
0 Votes"
AustinHunter-0219 asked ColeXia-MSFT edited

Issue with binding Picker SelectedItem and ItemDisplayBinding

I have a page that is being used as a form to collect data from the user. This same page is either being bound to a new object if the user is adding an item, or bound to an existing object if the user is editing an existing item. I have a picker control as part of this form. I have set breakpoints in my viewmodel which the page is being bound to and can clearly see that the property that my SelectedItem is bound to is being set properly from the loaded item. The list of items that the ItemsSource is bound to is working because I can focus the Picker and the expected appropriate items are showing up. However, the SelectedItem is never set and of course the ItemDisplayBinding is not set either. Whether it be a new or existing item, everytime the page loads the picker displays the Title I have set in the XAML. Other elements on the page are binding just fine. I can't quite figure out what would be causing this problem or if this is a known issue at this point. To make the stucture a little more clear:

ObservableCollection<MyItem>() is bound to the ItemsSource of my picker
MyItem is bound to the SelectedItem
MyItem.StringProperty is bound to the ItemDisplayBinding

All properties are currently implementing INotifyPropertyChanged().

dotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you show the code in xaml and code behind ? We need more information to troubleshoot the problem .

0 Votes 0 ·

0 Answers