Skip navigation

 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.

Charlie Calvert is doing a series that he calls Code Climber which discusses Lambdas from the bottom up. I’m sure it will be a great series when it’s all done.

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:

  • Window/Frame
  • UserControl
  • Control
  • FrameworkElement

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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: