public override async Task InitializeAsync() { IEnumerable <SynchedPhysicalContacts> contacts = null; try { //pull from cache contacts = await BlobCache.UserAccount.GetObject <IEnumerable <SynchedPhysicalContacts> >(CacheKeys.User_phyContacts); } catch (KeyNotFoundException ex) { //.LogInformation($"AuthenticationService::LoginAsync() Failed to retrieve authmodel from cache."); } if (contacts == null || contacts.Count() < 1) { await Xamarin.Essentials.MainThread.InvokeOnMainThreadAsync(() => { this.OnDataReady(this, new EventArgs()); }); return; } foreach (var item in contacts) { PhysicalContactsTrackings.Add(item); } await Xamarin.Essentials.MainThread.InvokeOnMainThreadAsync(() => { this.OnDataReady(this, new EventArgs()); }); }
private void CreateDummy() { PhysicalContactsTrackings.Add(new SynchedPhysicalContacts { Contacts = Backend.Core.Types.PhysicalContacts.Family_GrandFather, DateTime = System.DateTime.Now.AddHours(5), StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.Completed }); PhysicalContactsTrackings.Add(new SynchedPhysicalContacts { Contacts = Backend.Core.Types.PhysicalContacts.Family_GrandFather, DateTime = System.DateTime.Now.AddDays(10), StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.NotStarted }); PhysicalContactsTrackings.Add(new SynchedPhysicalContacts { Contacts = Backend.Core.Types.PhysicalContacts.Family_GrandFather, DateTime = System.DateTime.Now, StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.InProgress }); }
public async Task <SynchedPhysicalContacts> AddContact(PhysicalContacts contact, DateTime date, string Longitude, string Latitude) { var newContact = new SynchedPhysicalContacts { Contacts = contact, DateTime = date, Latitude = Latitude, Longiture = Longitude, StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.InProgress }; PhysicalContactsTrackings.Add(newContact); await Xamarin.Essentials.MainThread.InvokeOnMainThreadAsync(() => { this.OnDataReady(this, new EventArgs()); }); return(newContact); }