public void StartInteraction(object sender, EventArgs e) { SyncUtils.UpdateLocalTeamMembers().ContinueWith((arg) => { Device.BeginInvokeOnMainThread(() => { var realm = Realm.GetInstance(); if (!arg.Result) { DisplayAlert("Error!", "An error has occurred while acquiring the members of the team you are contained in.\n\nAre you sure you are contained in a team?", "OK"); return; } if (realm.All <TeamMember>().AsRealmCollection().Count == 0) { DisplayAlert("Error!", "The team you are contained in has no other members.", "OK"); return; } Navigation.PushAsync(new NewInteractionPage()); }); }); }
public HistoryPage() { InitializeComponent(); SyncUtils.UpdateLocalInteractionNotes().ContinueWith((arg) => { Device.BeginInvokeOnMainThread(() => { var interactions = LocalRealm.All <InteractionLog>().OrderByDescending(il => il.Date); HistoryListView.ItemsSource = interactions; HistoryListView.ItemSelected += (sender, e) => { if (e.SelectedItem == null) { return; } var il = (InteractionLog)e.SelectedItem; Navigation.PushAsync(new PastInteractionPage(il)); HistoryListView.SelectedItem = null; }; }); }); }
public MainPage() { InitializeComponent(); SyncUtils.UpdateLocalTeamMembers().ContinueWith((arg) => { System.Diagnostics.Debug.WriteLine("Updated local team member database!"); }); }