summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/Button.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/Button.cs')
-rw-r--r--Xamarin.Forms.Core/Button.cs21
1 files changed, 6 insertions, 15 deletions
diff --git a/Xamarin.Forms.Core/Button.cs b/Xamarin.Forms.Core/Button.cs
index bcd593ed..97d774c9 100644
--- a/Xamarin.Forms.Core/Button.cs
+++ b/Xamarin.Forms.Core/Button.cs
@@ -116,18 +116,13 @@ namespace Xamarin.Forms
void IButtonController.SendClicked()
{
- Command?.Execute(CommandParameter);
- Clicked?.Invoke(this, EventArgs.Empty);
- }
-
- void IButtonController.SendPressed()
- {
- Pressed?.Invoke(this, EventArgs.Empty);
- }
+ ICommand cmd = Command;
+ if (cmd != null)
+ cmd.Execute(CommandParameter);
- void IButtonController.SendReleased()
- {
- Released?.Invoke(this, EventArgs.Empty);
+ EventHandler handler = Clicked;
+ if (handler != null)
+ handler(this, EventArgs.Empty);
}
public FontAttributes FontAttributes
@@ -151,10 +146,6 @@ namespace Xamarin.Forms
public event EventHandler Clicked;
- public event EventHandler Pressed;
-
- public event EventHandler Released;
-
public Button()
{
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Button>>(() => new PlatformConfigurationRegistry<Button>(this));