This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Windows Presentation Foundation
.NET 4.0+

WPF Layout Controls Class Hierarchy

The seventeenth part of the Windows Presentation Foundation Fundamentals tutorial looks deeper into the WPF layout controls. This instalment details the inheritance hierarchy of the layout controls seen so far.

Layout Controls

So far in the WPF tutorial we have examined fourteen layout controls. These are the majority of the most commonly used controls that influence user interface layouts. The controls included the Canvas, StackPanel, Grid, GridSplitter, UniformGrid, WrapPanel, DockPanel, ViewBox, Expander, ScrollViewer, Border, GroupBox, TabControl and TabItem.

Each of these controls is represented by a class within the .NET framework. These classes are linked by inheritance to allow behaviour to be shared. Ultimately, as with all other .NET types, all of the controls we've seen inherit functionality from System.Object. However, the type hierarchy for the WPF controls is quite deep, with many controls inheriting from eight or nine superclasses. Understanding those base classes is fundamental to their correct use.

As we've seen at the most common layout controls, now is a good time to start looking at their type hierarchy. In this article I'll simply list the relationships between the layout controls and the hierarchy of classes up to System.Object. In the coming articles we'll examine each of the base classes in turn, seeing the functionality they add to controls and showing examples of some of their shared properties, methods and events. Those examples will include a mixture or XAML and C# code.

After describing the base classes for the layout controls we'll return to looking at more of the standard WPF controls. Some of these use the same base class functionality. Hopefully this will allow you to more easily apply the controls to your projects. In between looking at groups of related controls we'll also see further base classes.

Layout Control Type Hierarchy

The type hierarchy containing the classes for all of the layout controls that we've seen so far in the tutorial is as follows:

NB: The examination won't be exhaustive as the amount of functionality provided is very large and beyond the scope of a basic tutorial. However, there will be future articles both within and outside of the tutorial that will describe other elements.

18 June 2013