3

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?

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
Tim Lloyd
  • 37,954
  • 10
  • 100
  • 130

1 Answers1

1

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

Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393