summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/GalleryPages/AlertGallery.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages/AlertGallery.cs')
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/AlertGallery.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/AlertGallery.cs b/Xamarin.Forms.Controls/GalleryPages/AlertGallery.cs
new file mode 100644
index 00000000..8a666a10
--- /dev/null
+++ b/Xamarin.Forms.Controls/GalleryPages/AlertGallery.cs
@@ -0,0 +1,28 @@
+using System;
+using Xamarin.Forms;
+
+namespace Xamarin.Forms.Controls
+{
+ public class AlertGallery : ContentPage
+ {
+ public AlertGallery ()
+ {
+ var lblResult = new Label { Text = "Result: ", AutomationId = "testResult" };
+
+ var btn1 = new Button { Text = "Alert Override1", AutomationId = "test1" };
+ btn1.Clicked += async (sender, e) => {
+ await DisplayAlert ("TheAlertTitle", "TheAlertMessage", "TheCancelButton");;
+ };
+
+ var btn2 = new Button { Text = "Alert Override2", AutomationId = "test2" };
+ btn2.Clicked += async (sender, e) => {
+ var result = await DisplayAlert ("TheAlertTitle", "TheAlertMessage", "TheAcceptButton", "TheCancelButton");
+ lblResult.Text = string.Format("Result: {0}", result);
+ };
+
+ Content = new StackLayout { Children = { lblResult, btn1, btn2 }};
+ }
+ }
+}
+
+