diff options
-rw-r--r-- | Xamarin.PropertyEditing.Mac/HostResourceProvider.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs index 42720a8..7beea59 100644 --- a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs +++ b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs @@ -17,8 +17,14 @@ namespace Xamarin.PropertyEditing.Mac public HostResourceProvider () { - var containingDir = Path.GetDirectoryName (typeof (HostResourceProvider).Assembly.Location); - var bundlePath = Path.Combine (containingDir, "PropertyEditingResource.bundle"); + var bundlePath = NSBundle.MainBundle.PathForResource ("PropertyEditingResource", "bundle"); + if (!Directory.Exists (bundlePath)) + { + //if the bundle resource directory is not in place we fallback into the assembly location + var containingDir = Path.GetDirectoryName (typeof (HostResourceProvider).Assembly.Location); + bundlePath = Path.Combine (containingDir, "PropertyEditingResource.bundle"); + } + this.resourceBundle = new NSBundle (bundlePath); } |