views:

45

answers:

2

I have a series of WPF UserControls in a single Class Library. There are multiple levels to the controls and the top most level will use multiple lower level controls. Some of the low level controls import classes from other external DLLs and then use those classes in properties of the control. The problem is that when I try to drop one of those lower level controls into a higher level control they error when trying to render in the designer, stating that it cannot find the class assemblies used for the properties. They will, however work fine if dropped onto the main window of an executable and actually run perfectly in runtime mode, just not in the designer. Not the end of the world... but a royal pain.

As a quick example:

using MyClassLibrary;

public partial class MyControl : UserControl
{
    public MyControl {}

    public MyClass ClassInstance { get; set; }
}

The above code would render fine in the designer itself, just not when I try to use that control inside of another User control.

I also know the same problem can arise from external classes used in the constructor, OnLoaded, etc (anything that's run by the designer) but have already fixed those by checking if it's in Design mode and disabling that code from running. It's just that I cannot figure out how to have it not process the control properties.

Any ideas?

A: 

Did you reference the class in the Xaml? Example:

xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
Vivek
No... not in either of the controls. Which one would I do it in and how would I reference it for something that is already in the assemblies references? (MyControl.dll for example... it's not a microsoft thing)
Adam Haile
A: 

Does it have anything to do with this?

"Design-time support for XAML files in class libraries": http://trydal.wordpress.com/2010/03/18/design-time-support-for-xaml-files-in-class-libraries/

trydis
Gave it a shot, but unfortunately no, that's not it.
Adam Haile