#267 – Think Twice Before You Subclass a Control

In Windows Forms, when you wanted behavior in a control beyond what the standard controls provided, you’d subclass a specific control, subclass the Control class, or create a custom UserControl.

In WPF, you often don’t need to subclass a control or create a custom UserControl.  Through the use of styles and templates, you can generally customize the behavior of an existing control to meet the needs of your application.

 

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: