From 90668db3e18331edecd6ef179834f183b516d818 Mon Sep 17 00:00:00 2001 From: Joe Sauve Date: Fri, 15 Jan 2016 13:07:37 -0600 Subject: [PATCH 1/2] Added a PositiveAction Action to the MessagingServiceQuestion type. Can be used like this: var task = Application.Current?.MainPage?.DisplayAlert(info.Title, info.Question, info.Positive, info.Negative); if (task != null && await task) info.PositiveAction.Invoke(); --- FormsToolkit/FormsToolkit/Services/MessagingService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/FormsToolkit/FormsToolkit/Services/MessagingService.cs b/FormsToolkit/FormsToolkit/Services/MessagingService.cs index b7ead87..4e10281 100644 --- a/FormsToolkit/FormsToolkit/Services/MessagingService.cs +++ b/FormsToolkit/FormsToolkit/Services/MessagingService.cs @@ -82,11 +82,13 @@ public class MessagingServiceQuestion /// /// The title. public string Title {get;set;} + /// /// Gets or sets the question. /// /// The question. public string Question { get; set; } + /// /// Gets or sets the positive button text. /// @@ -98,6 +100,12 @@ public class MessagingServiceQuestion /// /// The negative. public string Negative { get; set; } + + /// + /// Gets or sets the positive action, that action that is to be executed if the Positive choice is selected. + /// + /// The positive action. + public Action PositiveAction { get; set; } } /// @@ -110,6 +118,7 @@ public class MessagingServiceAlert /// /// The title. public string Title {get;set;} + /// /// Gets or sets the message. /// From 446837a91a709f246b2d960ac7ac8cd2d6720dce Mon Sep 17 00:00:00 2001 From: Joe Sauve Date: Mon, 18 Jan 2016 13:04:25 -0600 Subject: [PATCH 2/2] Updated the Actions on MessagingServiceAlert and MessagingServiceQuestion --- .../FormsToolkit/Services/MessagingService.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/FormsToolkit/FormsToolkit/Services/MessagingService.cs b/FormsToolkit/FormsToolkit/Services/MessagingService.cs index 4e10281..9bb0c31 100644 --- a/FormsToolkit/FormsToolkit/Services/MessagingService.cs +++ b/FormsToolkit/FormsToolkit/Services/MessagingService.cs @@ -102,10 +102,10 @@ public class MessagingServiceQuestion public string Negative { get; set; } /// - /// Gets or sets the positive action, that action that is to be executed if the Positive choice is selected. + /// Gets or sets the OnCompleted Action<bool>. /// - /// The positive action. - public Action PositiveAction { get; set; } + /// The OnCompleted Action<bool>. + public Action OnCompleted { get; set; } } /// @@ -130,6 +130,12 @@ public class MessagingServiceAlert /// /// true if this instance cancel; otherwise, false. public string Cancel { get; set; } + + /// + /// Gets or sets the OnCompleted Action. + /// + /// The OnCompleted Action. + public Action OnCompleted { get; set; } } }