private async Task ProjectSelected(ListView sender) { var p = (sender.SelectedItem as ProjectModel); if (p != null) { if (!leaveProjectMode) { sender.SelectedItem = null; MasterFragment.EnterProjectContext(p); await Navigation.PushAsync(new ProjectPage (p)); } else { bool success = await DisplayAlert("Leaving " + p.Name, "Are you sure you want to leave this project?", "Certainly", "Nevermind"); sender.SelectedItem = null; if (success) { await App.LeaveProject(p); list.BeginRefresh(); } } } }
public RootSessionPage() { Title = "SHOUT!"; NavigationPage.SetTitleIcon(this, "bar_icon"); Master = new MasterFragment(this, PageSelected); Detail = new ContentPage(); //TODO: don't hardcode 1000ms try { if (App.User.Id == default(int)) { App.TryAutoLogin().Wait(1000); } SucceededAutoLogin(); } catch { FailedAutoLogin(); } }
protected override void OnAppearing() { base.OnAppearing(); MasterFragment.ExitProjectContext(); RefreshList(); }