diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-01-18 20:31:36 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2019-01-18 20:31:36 +0300 |
commit | 738f6caf093651e52da2d597f17cea60c3859934 (patch) | |
tree | f3561dcc0e96e4cedc2b6d0ba1c59e39a86f2fc1 /Xamarin.PropertyEditing.Mac | |
parent | a0fc91b672ce4510c4462116af223287f5ff8fa6 (diff) |
[mac] Add click events for underlined items
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs index af60712..43d2e83 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs @@ -5,6 +5,8 @@ using CoreGraphics; namespace Xamarin.PropertyEditing.Mac { internal interface IUnderliningTabView { + event EventHandler Clicked; + bool Selected { get; set; } int LineWidth { get; set; } } @@ -20,6 +22,8 @@ namespace Xamarin.PropertyEditing.Mac this.name = name; } + public event EventHandler Clicked; + private bool selected; public bool Selected { @@ -68,6 +72,12 @@ namespace Xamarin.PropertyEditing.Mac } } + public override void MouseDown (NSEvent theEvent) + { + Clicked?.Invoke (this, EventArgs.Empty); + base.MouseDown (theEvent); + } + private readonly IHostResourceProvider hostResources; private readonly string name; } @@ -82,6 +92,8 @@ namespace Xamarin.PropertyEditing.Mac Alignment = NSTextAlignment.Center; } + public event EventHandler Clicked; + private bool selected; public bool Selected { @@ -107,6 +119,12 @@ namespace Xamarin.PropertyEditing.Mac } } + public override void MouseDown (NSEvent theEvent) + { + Clicked?.Invoke (this, EventArgs.Empty); + base.MouseDown (theEvent); + } + public override void DrawRect (CGRect dirtyRect) { base.DrawRect (dirtyRect); |