Tim Lloyd
Tim Lloyd

Reputation: 38484

Visual Studio Designer Attached Properties

I am using attached properties to allow some design-time behaviour in the Visual Studio WPF designer i.e. design-time view-model data.

The issue I'm having is that when attached property events fire at design-time for my UserControl, the type of the DependencyObject is UserControl and not the concrete type I am expecting. At runtime the type of the DependencyObject is the concrete type as expected, e.g. BlingUserControl.

I want access to the concrete type as I need its namespace for a convention-based locater pattern.

Is there any way of getting at the concrete type at design-time?

Upvotes: 3

Views: 595

Answers (1)

Kent Boogaart
Kent Boogaart

Reputation: 178790

Afraid not. Visual Studio (and Blend, for that matter) both construct an instance of UserControl rather than an instance of your control itself.

Upvotes: 1

Related Questions