예제 #1
0
        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();
                    }
                }
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     MasterFragment.ExitProjectContext();
     RefreshList();
 }