diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicFillBox.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicFillBox.cs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicFillBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicFillBox.cs deleted file mode 100644 index a542b5d..0000000 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicFillBox.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using AppKit; - -namespace Xamarin.PropertyEditing.Mac -{ - internal class DynamicFillBox - : NSBox - { - public DynamicFillBox (IHostResourceProvider hostResources, string colorName) - { - if (hostResources == null) - throw new ArgumentNullException (nameof (hostResources)); - - BorderWidth = 0; - BoxType = NSBoxType.NSBoxCustom; - TranslatesAutoresizingMaskIntoConstraints = false; - this.colorName = colorName; - if (colorName == null) - FillColor = NSColor.Clear; - - HostResourceProvider = hostResources; - } - - public IHostResourceProvider HostResourceProvider - { - get { return this.hostResources; } - set - { - this.hostResources = value; - ViewDidChangeEffectiveAppearance (); - } - } - - public string FillColorName - { - get => this.colorName; - set - { - this.colorName = value; - if (value == null) - FillColor = NSColor.Clear; - - ViewDidChangeEffectiveAppearance (); - } - } - - public override void ViewDidChangeEffectiveAppearance () - { - if (this.colorName == null) - return; - - NSColor color = this.hostResources.GetNamedColor (this.colorName); - if (color == null) - return; - - FillColor = color; - } - - private IHostResourceProvider hostResources; - private string colorName; - } -} |