Demo and source code included below.

At some point you think wouldn’t it be better to move all this functionality to a super class ?
And right you are.
Since we all live in objectville it’s not so uncommon.
In my case I tried to move some of the boring position functionality to a base control.
We all know that creating a basecontrol is peanuts.
But when we do this in a Silverlight control we run in some trouble.
Since our control lives in two files defined by two partial classes.
Partners in crime are the XAML file and the .cs (aka codebehind) file.
So when our .cs file inherits from basecontrol our XAML has to follow.
You probably think so be it, no problem.
The problem occurs when you re-open that control in Expression Blend.
For no reason whatsoever Expression Blend kicks out the basecontrol.
If you don’t mind changing the XAML file every time you opened it in blend skip the rest of this post.
(more…)


