سؤال

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.

هل كانت مفيدة؟

المحلول

Try AssemblyTitle in your source like below:

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/YourProjectAssemblyTitle;component/Resources/Resources.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top