Sam Hobbs

Sam Hobbs

  • 53
  • 29.3k
  • 2.1m

Setter Property="Template" in Generic.xaml

Mar 6 2012 12:00 AM
I am attempting to create a WPF Custom Control but I am getting the error:
Generic.xaml(6,17): error MC4005: Cannot find the Style Property 'Template' on the type 'WpfCustomControlLibrary2.CustomControl1'.

The problem can be duplicated by simply creating a WPF Custom Conrols Library project then instad of deriving the control from the Control class, derive from Viewbox then build. That is all that is needed to get the error.

The line in Generic.xaml that the error is for is:
<Setter Property="Template">

There is probably an easy solution and I am probably trying to do somethig too advanced for a WPF beginner such as I. If someone can give me a clue of where to look then that will help. I am not sure that Viewbox is the best control to derive from. My custom control will have just one window in it so Viewbox appears to be the best fit.