CODEGATOR

.NET info worth sinking your teeth into!
Welcome to CODEGATOR Sign in | Join | Help
in Search

Martin Cook

Yet another C# developer with a blog.

WPF Control Library Trick # 1

[If you don't know what WPF is, it's Microsoft's new UI framework called: Windows Presentation Framework. Here is a good link for learning about WPF basics.]

I'm a self confessed WPF rookie so this trick is something that I learned this weekend while trying to get my first WPF control library to build. In my ignorance, I started my project as a Windows custom control library, like this:

Everything seemed fine as I created a WPF page and added it to the library, then I tried to compile. This is the error that I got:

 

That little error kept me busy for about an hour. Angry So anyway, the lesson I learned is that in order to create a WPF custom control library one should start by first opening the "Visual C#" node in the "New Project" dialog, then select the ".NET Framework 3.0" project type, then select the "Custom Control Library (WPF)" project template type. It should look like this:

Then, when you add your WPF types it will build like it's supposed to.

Oh well, learning new technology is not without it's little perils. Hopefully someone facing this problem will benefit from my frustration.

 

See ya!

 

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit

About Martin

I work as a software engineer specializing in designing and building object-oriented business solutions for Windows platforms using C#. I have been programming professionally for roughly 20 years.

This Blog

Syndication

Terms of Service | Privacy Statement