summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/ActionSheetArguments.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/ActionSheetArguments.cs')
-rw-r--r--Xamarin.Forms.Core/ActionSheetArguments.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/ActionSheetArguments.cs b/Xamarin.Forms.Core/ActionSheetArguments.cs
new file mode 100644
index 00000000..3417ed61
--- /dev/null
+++ b/Xamarin.Forms.Core/ActionSheetArguments.cs
@@ -0,0 +1,45 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace Xamarin.Forms
+{
+ internal class ActionSheetArguments
+ {
+ public ActionSheetArguments(string title, string cancel, string destruction, IEnumerable<string> buttons)
+ {
+ Title = title;
+ Cancel = cancel;
+ Destruction = destruction;
+ Buttons = buttons;
+ Result = new TaskCompletionSource<string>();
+ }
+
+ /// <summary>
+ /// Gets titles of any buttons on the action sheet that aren't <see cref="Cancel" /> or <see cref="Destruction" />. Can
+ /// be <c>null</c>.
+ /// </summary>
+ public IEnumerable<string> Buttons { get; private set; }
+
+ /// <summary>
+ /// Gets the text for a cancel button. Can be null.
+ /// </summary>
+ public string Cancel { get; private set; }
+
+ /// <summary>
+ /// Gets the text for a destructive button. Can be null.
+ /// </summary>
+ public string Destruction { get; private set; }
+
+ public TaskCompletionSource<string> Result { get; }
+
+ /// <summary>
+ /// Gets the title for the action sheet. Can be null.
+ /// </summary>
+ public string Title { get; private set; }
+
+ public void SetResult(string result)
+ {
+ Result.TrySetResult(result);
+ }
+ }
+} \ No newline at end of file