I've got a XF project using XAML & MVVM, developing in Visual Studio 2017. On one of my forms I've got a picker:
<Picker x:Name="pSite" Title="Site" SelectedItem="{Binding CurrentSite}" ItemsSource="{Binding SiteList}" HorizontalOptions="FillAndExpand">
The page binding is set to my view model, which has the properties of CurrentSite (which is the site the user has saved) and SiteList (which is the list of all possible sites). When I load this on my device(s) the picker shows no current selection.
To troubleshoot, I added a label bound to CurrentSite:
<Label VerticalTextAlignment="Center" Text="{Binding CurrentSite}"></Label>
This Label also shows no value. If I remove the SelectedItem="{Binding CurrentSite}"
from the picker, the Label shows the correct value (as stored in the database).
When walking through the debugger (breakpoing on the setting for CurrentSite) I see where it correctly grabs the current value from the database, but it is immediately set again to null.
Any idea why this is setting my Model value to null?
I'm currently using Xamarin.Forms v2.3.4.247
Thanks,
Ian