471,338 Members | 1,292 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

WPF: Cannot Create Custom Control in Project

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
Aug 18 '08 #1
2 5055
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_gut...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 (v-*****@online.microsoft.com, 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:
ms****@microsoft.com.

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

Aug 19 '08 #2
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

"Marco Zhou [MSFT]" wrote:
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_gut...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 (v-*****@online.microsoft.com, 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:
ms****@microsoft.com.

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

Aug 26 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Vivien Parlat | last post: by
1 post views Thread by =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post: by
3 posts views Thread by Just_a_fan | last post: by
23 posts views Thread by raylopez99 | last post: by
2 posts views Thread by syndev | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.