In the window XAML add the namespace of your control. So, if your control is called MyControl and your project is called MyProj then most likely the full namespace is MyProj.MyControl.

The control might look like this:

<UserControl
x:Class=MyControl


xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation


xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml>

    <DockPanel>

        <Button>Test</Button>

        <Button>Test</Button>

        <Button>Test</Button>

        <Button>Test</Button>

    </DockPanel>

</UserControl>

 

Your form header will look like this:

<Window
x:Class=Window1


xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation


xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml

    xmlns:l=clr-namespace:MyProj


Title=wpf
Height=300
Width=300

>

Then to use the control you will do this:

<l:MyControl></l:MyControl>

I got this to work in VS 2005 with WPF Extensions but I cannot get it to work in Orcas March CTP… The project compiles and runs fine in both cases, but the control will just not show up in the Orcas version!!! Any ideas?

This entry was posted on Friday, March 9th, 2007 at 10:53 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.