Advertisement
smeacham

MyContentPage.cs

May 31st, 2016
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. using Xamarin.Forms;
  8.  
  9. namespace ModalNavigationVS
  10. {
  11.     class MyContentPage : ContentPage
  12.     {
  13.         public MyContentPage()
  14.         {
  15.             Button OkDialogButton = new Button
  16.             {
  17.                 Text = "Show Alert"
  18.             };
  19.  
  20.             OkDialogButton.Clicked += async (sender, e) =>
  21.             {
  22.                 await DisplayAlert("Attention!", "You really to know about this.", "OK");
  23.             };
  24.  
  25.             Button GetFeedbackButton = new Button
  26.             {
  27.                 Text = "Get Feedback"
  28.             };
  29.  
  30.             GetFeedbackButton.Clicked += async (sender, e) =>
  31.             {
  32.                 Boolean answer = await DisplayAlert("Start", "Are you ready?", "Yes", "No");
  33.             };
  34.  
  35.             Button WhereButton = new Button
  36.             {
  37.                 Text = "Find out Where"
  38.             };
  39.  
  40.             WhereButton.Clicked += async (sender, e) =>
  41.             {
  42.                 String answer = await DisplayActionSheet("Options", "Cancel", null, "Here", "There", "Everywhere");
  43.             };
  44.  
  45.             StackLayout layout = new StackLayout
  46.             {
  47.                 Children = { OkDialogButton, GetFeedbackButton, WhereButton }
  48.             };
  49.  
  50.             this.Content = layout;
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement