So a user was asking in the WPF Forums how to get a UserControl to call a method on its parent. I told him the simplest way is to use a RoutedEvent and proceeded to give a code example that showed the basics.
This post inspired me to do a Code Climber of my own. I want to cover custom controls in WPF. Of course, the MSDN library already has a great overview of WPF control authoring, I wouldn’t presume to replace that documentation especially for those with a pressing deadline to learn this topic. But for those willing to take a journey with me, it could be fun.
Here is the Itinerary for our voyage:
The stops follow the path from commonplace, (I.e. practically every WPF UI developer will use a Window or Frame) to the more esoteric FrameworkElement. Interestingly enough, FrameworkElement based custom controls may be MOST familiar to those used to custom control development for Winforms/GDI+, where developers are used to rendering the control directly using graphics primitives. Whereas the paradigm for developing custom controls that derive from System.Windows.Controls.Control would be most familiar for someone developing an ASP.Net server-side control.
It’s a little bit past my bedtime, but look forward to seeing the first entry talking about everyone’s favorite custom control: Window1.