472,975 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,975 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 5165
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pon | last post by:
Hi everybody, I posted that on the Avalon ng but it seems there is not so much wpf developpers which use VB. Is there more VB developpers which work with WPF ? I'm trying to do a very simple...
4
by: moondaddy | last post by:
I'm trying to databind a dependency property in a custom control (CenterX) to the Line.X1Property property of line. If I can correctly do this (and the same for the 'Y' props) then when I drag my...
3
by: moondaddy | last post by:
I have a windows WPF sample project which is starting to work pretty good. I can drag shapes and lines, and connect a straight line to any place on a custom rectangle shape's boarder. Now I have a...
6
by: Vivien Parlat | last post by:
Hello, I hope i'm posting into the good group, i found no active group around xaml. My situation is the following: I'm trying to play around xaml in the new VC# Express 2008. My "aim" (i...
1
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello All-- Just a general (or perhaps loaded) question - is it considered good or bad practice to use code-behind with a CustomControl.generic.xaml file? For instance, with a control I'm...
3
by: Just_a_fan | last post by:
I have been through two books where they talk about the (almost) parallel control set for WPF and VB. They go through the small difference and talk about everything going on a form but what they...
7
by: Linda Liu[MSFT] | last post by:
Hi George, I have downloaded your sample solution and built it on my machine. I got a compilation error indicating that the type of "CustomResources" doesn't exist in the following xaml code: ...
23
by: raylopez99 | last post by:
Here I am learning WinForms and two months into it I learn there's a WPF API that is coming out. Is this WPF out yet, and is it a threat to WinForms, in the sense that all the library routines I...
2
by: syndev | last post by:
Hi, I am trying to use a wpf custom control (that I created seperately, simple hello world, with no UI) on a web page (.aspx) in a web application. Is it possible to use a wpf custom control like...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.