K
Karlitos2312
Guest
Hi,
In a Visual Studio Xamarin.Forms Portable project - I am trying to integrate windowsazure mobileServices.
In BaseViewModel.cs
/*******************************************/
using System;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.MobileServices.SQLiteStore; // offline sync
using Microsoft.WindowsAzure.MobileServices;
using Windows.UI.Popups;
using ForeXamarin.Models;
namespace ForeXamarin.ViewModels
{
class BaseViewModel
{
public async Task InitLocalStore()
{
if (!App.MobileService.SyncContext.IsInitialized)
{
string errorString = null;
try
{
var store = new MobileServiceSQLiteStore("localstore.db");
store.DefineTable<Facilities>();
store.DefineTable<Courses>();
store.DefineTable<Yardages>();
store.DefineTable<Tees>();
store.DefineTable<AzureShapes>();
store.DefineTable<ShapeTypes>();
await App.MobileService.SyncContext.InitializeAsync(store);
}
catch (Exception ex)
{
errorString = "BaseViewModel: " + ex.Message;
}
if (errorString != null)
{
MessageDialog d = new MessageDialog(errorString);
await d.ShowAsync();
}
}
}
}
}
/*************************************************************/
Error CS4036 'IAsyncOperation<IUICommand>' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation<IUICommand>' could be found (are you missing a using directive for 'System'?)
Any of the solutions suggested for similar problems say that using Systeml; is required. As you can see from the code snippet - it is already included, but I still get the error.
Any help would be much appreciated.
Karl
Continue reading...
In a Visual Studio Xamarin.Forms Portable project - I am trying to integrate windowsazure mobileServices.
In BaseViewModel.cs
/*******************************************/
using System;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.MobileServices.SQLiteStore; // offline sync
using Microsoft.WindowsAzure.MobileServices;
using Windows.UI.Popups;
using ForeXamarin.Models;
namespace ForeXamarin.ViewModels
{
class BaseViewModel
{
public async Task InitLocalStore()
{
if (!App.MobileService.SyncContext.IsInitialized)
{
string errorString = null;
try
{
var store = new MobileServiceSQLiteStore("localstore.db");
store.DefineTable<Facilities>();
store.DefineTable<Courses>();
store.DefineTable<Yardages>();
store.DefineTable<Tees>();
store.DefineTable<AzureShapes>();
store.DefineTable<ShapeTypes>();
await App.MobileService.SyncContext.InitializeAsync(store);
}
catch (Exception ex)
{
errorString = "BaseViewModel: " + ex.Message;
}
if (errorString != null)
{
MessageDialog d = new MessageDialog(errorString);
await d.ShowAsync();
}
}
}
}
}
/*************************************************************/
Error CS4036 'IAsyncOperation<IUICommand>' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation<IUICommand>' could be found (are you missing a using directive for 'System'?)
Any of the solutions suggested for similar problems say that using Systeml; is required. As you can see from the code snippet - it is already included, but I still get the error.
Any help would be much appreciated.
Karl
Continue reading...