diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-03-22 19:08:47 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2019-03-26 01:15:53 +0300 |
commit | 90383f96ded1ad04484f203b912524b88e33df6b (patch) | |
tree | cddbbc64479c6341fdfe1e60de59c1329877f0f5 /Xamarin.PropertyEditing.Mac/Controls | |
parent | f199c61780ea73309eea088202ff08c8cb18ef17 (diff) |
[mac] Fix enabled into refactor
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs index ff394e8..f1d92ac 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs @@ -1,7 +1,6 @@ using System; using AppKit; using Foundation; -using Xamarin.PropertyEditing.Mac.Resources; using Xamarin.PropertyEditing.ViewModels; namespace Xamarin.PropertyEditing.Mac @@ -50,6 +49,11 @@ namespace Xamarin.PropertyEditing.Mac Entry.StringValue = GetValue (ViewModel.Value) ?? String.Empty; } + protected override void SetEnabled () + { + Entry.Enabled = ViewModel.Property.CanWrite; + } + protected override void UpdateAccessibilityValues () { Entry.AccessibilityEnabled = Entry.Enabled; @@ -77,12 +81,6 @@ namespace Xamarin.PropertyEditing.Mac ViewModel = viewModel; } - public override void EditingEnded (NSNotification notification) - { - var text = (NSTextField)notification.Object; - ViewModel.Value = GetValue (text.StringValue); - } - protected PropertyViewModel<T> ViewModel { get; @@ -94,6 +92,12 @@ namespace Xamarin.PropertyEditing.Mac this.lastValid = text.StringValue; } + public override void EditingEnded (NSNotification notification) + { + var text = (NSTextField)notification.Object; + ViewModel.Value = GetValue (text.StringValue); + } + public override bool TextShouldEndEditing (NSControl control, NSText fieldEditor) { if (!CanGetValue (fieldEditor.Value)) { |