I have a ResourceDictionary
in a xaml
file called SylesResourceDictionary.xaml in a Class Library
Project. This ResourceDictionary
is used in different views by Merging.
I'm new to ResourceDictionary
and not sure if I'm doing it the right way. Different article suggest different Build Action Like Page
and Custom Tool Like XamlIntelliSenseFileGenerator
What should be the Build Action
for this xaml file ? I have it set to Resource
What should be the Custom Tool
? I have it set to MSBuildCompile
Should I delete the xaml.cs
file for this xaml file ?
ResourceDictionary
should be set to Page
. XamlIntelliSenseFileGenerator
. Only the XAML compiler knows how to compile the XAML file to BAML. ResourceDictionary
may have a code-behind file but by default it's XAML only. You may also want to consider creating a project using either the WPF Custom Control Library
template or the WPF User Control Libary
template instead of using the Class Library
template. This will make it easier working with WPF and XAML specific types in Visual Studio. You will still be able to add any other types to the project as well.
In general:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.