Question

In a WPF application, Resources.xaml(Resource Dictionary) is placed in Resources folder and GetStarted.xaml(UserCOntrol) is placed in Views folder. Wizard.xaml(UserControl) is in the root folder.

Now, in Wizard.xaml:

<ResourceDictionary.MergedDictionaries>
    <ResousrceDictionary Source="Resources/Resources.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

works fine.

I'm not sure how to access it In GetStarted.xaml,

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="component/Resources/Resources.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

doesn't work.

Please help me. I'm new to WPF.

Was it helpful?

Solution

Try AssemblyTitle in your source like below:

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/YourProjectAssemblyTitle;component/Resources/Resources.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top