void OnBackButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; Page page = (Page)Activator.CreateInstance(typeof(EventsPage)); NavigationUtil.SwitchDetailPage(page); }
void OnRidesButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; Int32 eventId = (Int32)button.CommandParameter; RidesPage page = new RidesPage(eventId);//(RidesPage)Activator.CreateInstance(typeof(RidesPage)); NavigationUtil.SwitchDetailPage(page); }
void OnOfferRideButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; OrgEvent orgEvent = (OrgEvent)button.CommandParameter; OfferRidesPage page = new OfferRidesPage(orgEvent); NavigationUtil.SwitchDetailPage(page); }
public LoginPage() { InitializeComponent(); if (UserService.getInstance().GetUser() != null) { NavigationUtil.SwitchDetailPage(typeof(EventsPage), "Events"); } }
void OnJoinButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; Int16 orgId = (Int16)button.CommandParameter; User user = UserService.getInstance().GetUser(); if (!user.Organizations.Contains(orgId)) { user.Organizations.Add(orgId); UserService.getInstance().SaveUser(user); Console.WriteLine("Org ID " + orgId + " is added"); NavigationUtil.SwitchDetailPage(typeof(EventsPage), "events"); } }
void OnLoginButtonClicked(object sender, EventArgs e) { User user = UserService.getInstance().GetUser(emailEntry.Text, passwordEntry.Text); if (user != null) { NavigationUtil.SwitchDetailPage(typeof(EventsPage), "Events"); } else { messageLabel.Text = "Login failed"; passwordEntry.Text = string.Empty; } }
protected override void OnAppearing() { base.OnAppearing(); User user = UserService.getInstance().GetUser(); if (user != null) { if (user.Organizations.Count > 0) { NavigationUtil.SwitchDetailPage(typeof(EventsPage), "Events"); } else { NavigationUtil.SwitchDetailPage(typeof(OrganizationPicker), "Join Organization"); } } }
public void OnRegisterButtonClicked(object sender, EventArgs e) { NavigationUtil.SwitchDetailPage(typeof(RegisterPage), "Register"); }