Hi !
I'm trying to set the Source property of a ResourceDictionary to an Uri referencing a XAML file being part of the project.
**The result is an exception : **
- An exception of type 'System.Exception' occurred in System.Windows.ni.dll but was not handled in user code
- Additional information: Error HRESULT E_FAIL has been returned from a call to a COM component.
Stack Trace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, String s)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.ResourceDictionary.set_Source(Uri value)
at MyLibrary.MyService.Init()
at ResourceLoader.App..ctor()
at ResourceLoader.WinPhone.MainPage..ctor()
In more details, I have four projects in my solution (see attached solution to reproduce the exception):
- MyLibrary.Core : a PCL containing a service which will be consumed in my ResourceLoader mobile project
- MyLibrary : A Windows Phone Silverlight 8.0 project which contains the specific platform implementation of my service and the XAML file that I need to use (ui/MyStyle.xaml).
- ResourceLoader : my Xamarinn.Forms PCL project
- ResourceLoader : My WinPhone Silverlight 8.0 project
Someone could help please?
Thanks in advance