summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/GalleryPages/ActionSheetGallery.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages/ActionSheetGallery.cs')
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/ActionSheetGallery.cs64
1 files changed, 64 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/ActionSheetGallery.cs b/Xamarin.Forms.Controls/GalleryPages/ActionSheetGallery.cs
new file mode 100644
index 00000000..4f60c1e1
--- /dev/null
+++ b/Xamarin.Forms.Controls/GalleryPages/ActionSheetGallery.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Xamarin.Forms.Controls
+{
+ public class ActionSheetGallery : ContentPage
+ {
+ public ActionSheetGallery ()
+ {
+ AutomationId = "ActionSheetPage";
+
+ var extras = new string[] {
+ "Extra One",
+ "Extra Two",
+ "Extra Three",
+ "Extra Four",
+ "Extra Five",
+ "Extra Six",
+ "Extra Seven",
+ "Extra Eight",
+ "Extra Nine",
+ "Extra Ten",
+ "Extra Eleven",
+ };
+
+ Content = new ScrollView {
+ Content = new StackLayout {
+ Spacing = 0,
+ Children = {
+ MakeActionSheetButton (this, "ActionSheet Cancel", null, "Cancel", null),
+ MakeActionSheetButton (this, "ActionSheet Cancel Extras", null, "Cancel", null, extras),
+ MakeActionSheetButton (this, "ActionSheet Cancel Destruction", null, "Cancel", "Destruction"),
+ MakeActionSheetButton (this, "ActionSheet Cancel Destruction Extras", null, "Cancel", "Destruction", extras),
+ MakeActionSheetButton (this, "ActionSheet Destruction", null, null, "Destruction"),
+ MakeActionSheetButton (this, "ActionSheet Destruction Extras", null, null, "Destruction", extras),
+ MakeActionSheetButton (this, "ActionSheet Extras", null, null, null, extras),
+ MakeActionSheetButton (this, "ActionSheet Title", "Title", null, null),
+ MakeActionSheetButton (this, "ActionSheet Title Cancel", "Title", "Cancel", null),
+ MakeActionSheetButton (this, "ActionSheet Title Cancel Extras", "Title", "Cancel", null, extras),
+ MakeActionSheetButton (this, "ActionSheet Title Cancel Destruction", "Title", "Cancel", "Destruction"),
+ MakeActionSheetButton (this, "ActionSheet Title Cancel Destruction Extras", "Title", "Cancel", "Destruction", extras),
+ MakeActionSheetButton (this, "ActionSheet Title Destruction", "Title", null, "Destruction"),
+ MakeActionSheetButton (this, "ActionSheet Title Destruction Extras", "Title", null, "Destruction", extras),
+ MakeActionSheetButton (this, "ActionSheet Title Extras", "Title", null, null, extras),
+ }
+ }
+ };
+ }
+
+ static Button MakeActionSheetButton (Page page, string buttonText, string title, string cancel, string destruction, params string[] extras)
+ {
+ var actionSheetButton = new Button {
+ Text = buttonText
+ };
+
+ actionSheetButton.Clicked += async (sender, e) => await page.DisplayActionSheet (title, cancel, destruction, extras);
+
+ return actionSheetButton;
+ }
+ }
+}