Okay, so here's the deal. I'm new to Xamarin Forms - and I've only been writing code for about a year (Java for Android). I'm working on a project and using Xamarin Forms Shell, but I'm having trouble getting my MVVM working correctly.
When I load my DetailsPage I set up the Binding Context with my ViewModel:
public ItemDetailsPage()
{
InitializeComponent();
BindingContext = viewModel = new ItemDetailsViewModel();
}
In my ViewModel, I've created my ObservableCollection based on my POCO, and I have an async command requesting the data from the API. And through my Debug messages, I know I'm getting COMPLETE/OK responses when it loads (takes no more than 700ms). This is followed by the json deserialization like so:
string authCode = Application.Current.Properties["auth_token"] as string;
var restClient = new RestClient(base_api_uri).UseSerializer(() => new JsonNetSerializer());
restClient.AddDefaultHeader("Content-type", "application/json");
var restRequest = new RestRequest("/1/items/complete/{itemNumber}", Method.POST);
restRequest.AddHeader("Authorization", authCode);
restRequest.AddParameter("itemNumber", "1525252", ParameterType.UrlSegment);
restRequest.AddJsonBody(itemSearch);
var cancellationTokenSource = new CancellationTokenSource();
var itemResults = await restClient.ExecuteTaskAsync(restRequest, cancellationTokenSource.Token);
Debug.WriteLine("REST RESPONSE: " + itemResults.ResponseStatus + " " + itemResults.StatusCode);
ItemCompleteDetail allItemDeets = JsonConvert.DeserializeObject<ItemCompleteDetail>(itemResults.Content);
return allItemDeets;
Yet in my view, even though I have the Label associated with the value in my object, nothing ever displays. I'm sure I'm just missing something obvious, since I'm still wet-behind-the-ears with Xamarin, but does anyone have any ideas to help me?