I'm using this method to update a tuple of a particular table
public async void Update(MyTable entity)
{
SQLiteAsyncConnection conn = new SQLiteAsyncConnection(path);
await conn.UpdateAsync(entity);
}
Reference: http://msdn.microsoft.com/en-us/library/windows/apps/dn263243.aspx
Now in main, i'm trying to update a record in MyTable & I'm binding MyTable records to a ViewModel which is bound to the view.
private async void button_Tapped(object sender, TappedRoutedEventArgs e)
{
MyTableRepository.Update(scheduleRecord);
this.DefaultViewModel["MyViewModel"] =await ViewModelClass.GetMyTableDataAsync();
}
The problem here is that the view is not getting updated. After I stop the application & check db values, the db seems to be updated & after that if i run the app again, the required updated view is displayed.
I'm new to async-await. So my feeling is that maybe ViewModel is updated even before
MyTableRepository.Update(scheduleRecord);
is executed. I actually dont know the exact cause. Please Help.