WPF: Cannot Create Custom Control in Project

W

Wonko the Sane

Hello,

I have an existing (WPF) Class Library project that I'd like to add a WPF
Custom Control to. However, when I try to Add New Item, that isn't one of
the available options. Perhaps this is a brain freeze, but what could I
possibly be missing?

WtS
 
M

Marco Zhou [MSFT]

Hello Wonko,

Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. It's
my pleasure to work with you on this post.

If what you mean by "WPF" class project is the plain class project (created
from New-> Project -> Class Project), then I can verify that It seems that
Visual Studio doesn't provide a direct way to add custom control into a
class project, but if you are starting with "WPF Custom Control Library"
project selected from the project dialog, then you could directly add
custom control into it.

So I recommend you to create a new "WPF Custom Control Library" project,
and copy all those project files from the original class project into this
new project.
Another solution is to define custom item template, Scott Guthrie has
illustrated how to add custom item template for web project at the
following link:

http://thedotnet.com/blogs/scott_guthrie/archive/2005/09/10/595450.aspx

The same method can be employed to add custom control item template for
class project.

Please let me know if my suggestion is helpful to you. If you have
any other questions or concerns, don't hesitate to tell me.

--------------------------------------------------
Best regards,
Macro Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Wonko the Sane

Hi Marco,

I haven’t really had a chance to thoroughly investigate this, but...

It seems like it must be something in the project file, or something. If I
create a WPF Windows app, and then change the properties of that project to
Class Library, I believe I can still create custom controls in that project.

WtS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top