By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,386 Members | 1,782 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,386 IT Pros & Developers. It's quick & easy.

WPF: Cannot Create Custom Control in Project

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.