Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I move my resource dictionary in Silverlight?

For some reason the following code is giving me an exception.

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/PPCa.Common.Infrastructure;component/Skins/Default.xaml"/>
            <ResourceDictionary>
                <app:ResourceWrapper x:Key="ResourceWrapper" />
                <app:NotOperatorValueConverter x:Key="NotOperatorValueConverter" />
            </ResourceDictionary>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>                
</Application.Resources>

Here is the exception:

System.Windows.Markup.XamlParseException occurred
  Message=Failed to assign to property 'System.Windows.ResourceDictionary.Source'. [Line: 11 Position: 44]
  LineNumber=11
  LinePosition=44
  StackTrace:
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
  InnerException: 

Line 11 is this:

<ResourceDictionary Source="/PPCa.Common.Infrastructure;component/Skins/Default.xaml"/>

Am I somehow merging my dictionaries wrongly?

like image 719
Jordan Avatar asked Dec 04 '22 09:12

Jordan


1 Answers

Why is no one answering my questions? Am I blacklisted or something. People used to help me out quite a bit more. Anyway, I discovered my problem. The exception was a red herring. The problem had nothing to do with my application resource definition. The problem I was having deep inside my resource dictionaries. I was merge-referencing a dictionary inside my dictionary that no longer existed. That was difficult to figure out.

like image 152
Jordan Avatar answered Dec 27 '22 00:12

Jordan