partial class -- why?

Nov 20, 2009 at 4:00 PM

I'm building a reusable controls library for my company and have been using the WPF Toolkit as a model to follow for how to organise folders, theme styles, etc.  One point I'm confused on is why certain control classes in the WPF Toolkit, such as Calendar and DatePicker -- are declared as partial?  For example:

public partial class DatePicker : Control
    { ...

public partial class Calendar : Control
    { ...

These are not user controls, meaning they don't have a code-behind file, so what's the point?


Nov 20, 2009 at 5:45 PM

I think the reason is that a user of the toolkit can extend the Calendar class with code while seperating the toolkit code from the custom code.