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.
In the Solution Explorer, right click the DataPresenter's folder, click Add, and then click New Item… In the Add New Item dialog box, select ResourceDictionary (WPF), and assign it a name matching the style group's name (i.e., DataPresenter, Editors, or Primitives). Click Add.
Tip You can create a resource dictionary file in Microsoft Visual Studio by using the Add > New Item… > Resource Dictionary option from the Project menu. Here, you define a resource dictionary in a separate XAML file called Dictionary1.
WPF supports different types of resources. These resources are primarily two types of resources: XAML resources and resource data files. Examples of XAML resources include brushes and styles. Resource data files are non-executable data files that an application needs.
Try AssemblyTitle in your source like below:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/YourProjectAssemblyTitle;component/Resources/Resources.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With