public AlertDetailsPage(AlertNavigationPage alertManager) { // MAP MODULE // Address // Map // TEXT MODULE // Room -- Floor // SEND MODULE //Button // Create Screen Elements var button = new Button { Text = "Send Test Alert", TextColor = Color.White, BackgroundColor = Color.Red, HorizontalOptions = LayoutOptions.FillAndExpand, MinimumHeightRequest = 100 }; button.Clicked += (sender, e) => { alertManager.SendAlert (); }; // Create Screen Content Content = new ContentView { Content = new StackLayout { Children = { button } } }; }
public AlertTypePage(AlertNavigationPage alertManager) { this.alertManager = alertManager; // Create Screen Elements var emergencyButton = new Button { Text = "Emergency Alert", TextColor = Color.White, BackgroundColor = Color.Gray, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, MinimumHeightRequest = 300 }; emergencyButton.Clicked += (sender, e) => { alertManager.alert.type = AlertType.Emergency; alertManager.GotoAlertDetails(); }; var nervousButton = new Button { Text = "Nervous Alert", TextColor = Color.White, BackgroundColor = Color.Gray, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, MinimumHeightRequest = 300, }; nervousButton.Clicked += (sender, e) => { alertManager.alert.type = AlertType.Nervous; alertManager.GotoAlertDetails(); }; // Create Screen Content Content = new ContentView { Content = new StackLayout { VerticalOptions = LayoutOptions.CenterAndExpand, Spacing = 50, Children = { emergencyButton, nervousButton } } }; }
/* Navigation Functions */ private void openAlertPage() { var alertNav = new AlertNavigationPage (api); alertNav.doneAction = () => { Navigation.PopModalAsync (); }; Navigation.PushModalAsync (alertNav); }