I have a Xamarin app that I've recently included into a web service using Xamarin, working with a wcf web service, and works fine (http://developer.xamarin.com/guides/cross-platform/xamarin-forms/web-services/consuming/wcf/)
There is a ListView tutorial and this works fine calling the async web service using a Command in the controller, and binding that to the Listview.
So for my problem, What is the best way to load async web service data into the xamarin picker control when the form loads?
I've tried doing something in the viewmodel constructor, but the control data renders before the data comes back....
public class UserPreferencesViewModel : BaseViewModel
{...
public UserPreferencesViewModel()
{
LoadDropdownData();
//carries on while data is being queried
}
async Task LoadDropdownData()
{
Services = new ObservableRangeCollection<Service>();
var services = await App.ServiceManager.GetServiceDataAsync();
Services.ReplaceRange(services);
}
And I cannot seem to use a command object as there is no RefreshCommand property.
I also have preference data that i need to set the picker value to, and wondering how best to do this.
Hope this makes sense