I am looking for a good way to simplify and organise a complicated WPF custom control.
My first thought is to factor it out into two simpler controls. For the sake of explanation I'll call these SimpleControl and AdvancedControl.
SimpleControl contains all the core functionality and is extremely reusable.
AdvancedControl depends upon SimpleControl and contains input handling and extra bells and whistles. AdvancedControl is less reusable than SimpleControl because it contains extra UI elements and application specific input handling.
The visual template for AdvancedControl is what defines the dependence on SimpleControl. When OnApplyTemplate is called it caches a reference to the embedded SimpleControl.
The main problem with this approach is that all the properties and methods that are available on SimpleControl I also want to be available on AdvancedControl. This means a lot of work implementing the same dependency properties and methods on AdvancedControl and then just forwarding them through to SimpleControl. This doesn't seem to be particularly elegant.
I also thought about inheriting AdvancedControl from SimpleControl but I think in this case I would have to completely redefine the visual template for SimpleControl instead of just reusing the existing one.
Can anyone think of a better way of factoring out a complicated WPF custom control?