UiElement from abstract class

Posted by plotnick on Stack Overflow See other posts from Stack Overflow or by plotnick
Published on 2010-04-20T16:01:07Z Indexed on 2010/04/20 16:03 UTC
Read the original article Hit count: 417

Filed under:

I placed a control into a grid. let's say the control is derived from public class 'ButBase' which is derived in its turn from System.Windows.Controls.Button. The code normally compiles and app works just fine. But there's something really annoying.

When you try to switch to xaml-design tab it will say 'The document root element is not supported by the visual designer', which is normal and I'm totally okay with that, but the thing is, that all the xaml code is underlined and VS2010 says: 'Cannot create an instance of ButBase' although still normally compiles and able to run.

I've tried the same code in VS2008, it said that needs to see a public parameterless constructor in the ButBase, and even after I put one it showed the same error.

What do I miss here?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about derived-class