The Display Element Hierarchy


We can now create windows and place elements in them. We have noticed that some elements, for example, StackPanel and Canvas, can act as containers for other elements. At this point, we need to consider how the element classes relate to each other. They are structured in the form of a class hierarchy. A child class can extend a parent class, using the abilities and properties of the parent while adding and overriding behavior, as it requires.

Figure 7-16 shows the hierarchy of some of the elements in the Windows Presentation Foundation implementation on the .NET Micro Framework. All display items descend from the class UIElement. This class provides a set of core behaviors and properties common to all display elements. As an example, all elements must have a Visibility property that controls whether the property is visible. They also need properties to control alignment in the display area provided by the container object. The properties HorizontalAlignment and VerticalAlignment are used to manage these for all elements.

image from book
Figure 7-16: Part of the display-element class hierarchy.




Embedded Programming with the Microsoft .Net Micro Framework
Embedded Programming with the Microsoft .NET Micro Framework
ISBN: 0735623651
EAN: 2147483647
Year: 2007
Pages: 118

Similar book on Amazon
Getting Started with the Internet of Things: Connecting Sensors and Microcontrollers to the Cloud (Make: Projects)
Getting Started with the Internet of Things: Connecting Sensors and Microcontrollers to the Cloud (Make: Projects)
Expert .NET Micro Framework (Expert's Voice in .NET)
Expert .NET Micro Framework (Expert's Voice in .NET)
Netduino Plus
Netduino Plus
Getting Started with Netduino
Getting Started with Netduino

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net