Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

New Post: Resource keyname conflict between application resources

$
0
0
We have several independent apps that we are trying to tie together as a MEF application. Each of the original apps had common resources declared in App.Xaml. Now with MEF, there are no instances of those apps and consequently, no common resources. That causes the xaml that depended on those StaticResources to fail.

So I added my App's resources through code like this (in Delphi Prism):
   class procedure GlobalResources.LoadResources;

      procedure LoadResource( resourceUri : String );
         var 
            rd : ResourceDictionary;
         begin
         rd := new ResourceDictionary( Source := new Uri( resourceUri, UriKind.Relative ) );
         Application.Current.Resources.MergedDictionaries.Add( rd );
         end;

      begin
      LoadResource( '/GuardianEditObservation;component/Assets/ConverterResources.xaml' );
      LoadResource( '/GuardianEditObservation;component/Assets/Styles.xaml' );
      LoadResource( '/GuardianEditObservation;component/Assets/EditObservationViewResources.xaml' );
      end;
That made everything work in the MEF application. However, these resources all have to have keys. And some other app might be using the SAME keys.

Isn't this going to be a problem if two app (xaps) contain global resources with the same keys? Is there a way to specify the StaticResource so that it resolves the ambiguities?

Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>