diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs index f8f3c54..76868b6 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs @@ -8,18 +8,22 @@ namespace Xamarin.PropertyEditing.Mac { const int DefaultIconButtonSize = 32; - public BasePopOverControl (string title, string imageNamed) : base () + public BasePopOverControl (IHostResourceProvider hostResources, string title, string imageNamed) : base () { if (title == null) throw new ArgumentNullException (nameof (title)); if (imageNamed == null) throw new ArgumentNullException (nameof (imageNamed)); + if (hostResources == null) + throw new ArgumentNullException (nameof (hostResources)); TranslatesAutoresizingMaskIntoConstraints = false; WantsLayer = true; + HostResources = hostResources; + var iconView = new NSImageView { - Image = PropertyEditorPanel.ThemeManager.GetImageForTheme (imageNamed), + Image = hostResources.GetNamedImage (imageNamed), ImageScaling = NSImageScale.None, TranslatesAutoresizingMaskIntoConstraints = false, }; @@ -46,8 +50,12 @@ namespace Xamarin.PropertyEditing.Mac NSLayoutConstraint.Create (viewTitle, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 120), NSLayoutConstraint.Create (viewTitle, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, PropertyEditorControl.DefaultControlHeight), }); + } - Appearance = PropertyEditorPanel.ThemeManager.CurrentAppearance; + protected IHostResourceProvider HostResources + { + get; + private set; } } } |