My code customizes a WPF ListBox
object using styles. I would like to convert this code into a class definition (for reuse). Since I am not extending the ListBox
but only styling it, I am told in various textbooks and by experts that a User Control or a Custom Control is not necessary.
So, I choose the "C# Class Library" project type from Visual Studio to create the class code. However, because this type of project is generic and not WPF-specific, when I try to add a Resource Dictionary to my class, that option is missing from the Add menu (see picture).
This makes me question whether I am on the right track to begin with?
I have checked other related SO questions (such as this one) but none of them show how to create a WPF-specific class library that is not a user or custom control).
C#, Windows 7, Visual Studio 2010.
Yeah, you're fine. Just use Add>New Item... and search for the proper Resource template. Done.
Options in that menu are based on the project type. They're barely useful. I usually always use the dialog and search to find my templates.