October 29, 2010 14:49
You might want to derive your own custom control class not from UserControl but instead from an abstract class that then inherits from UserControl. This works fine in code such that your hierarchy looks like:
UserControl –> AbstractClass –> CustomView
The problem is that the WPF designer does not support abstract classes:

It's more of a hassle than anything else because you can't see your UI.
There is a workaround for this that I've been using. It might not be the only solution, but it seems to do the job.
In your abstract class, define the class itself as:
1: #if DEBUG
2: public class AbstractClass : UserControl
3: #else
4: public abstract class AbstractClass : UserControl
5: #endif
In this way, the abstract keyword only comes into play in release code. Yes, it makes it so you can instantiate AbstractClass in debug code, and also you can get away with not implementing virtual methods if the abstract class contains any, but don't do that. If you do, the compiler will just catch these things as errors when you try to compile release.
[ Follow me on Twitter ]