Partager via


IXRPanel (Windows Embedded CE 6.0)

1/6/2010

This class provides a base class for all panel elements. You can use panel elements as containers to position and arrange child objects in your Silverlight-based application.

Syntax

class IXRPanel : public IXRFrameworkElement

Methods

Method Description

IXRPanel::GetBackground

Retrieves the Brush that is used to fill the panel.

IXRPanel::GetChildren

Retrieves the collection of child elements of the panel.

IXRPanel::SetBackground

Sets the Brush to use to fill the panel.

Remarks

To position elements in your application UI, you must put them in a panel object. The intermediate base class IXRPanel has defined layout behavior that determines how your object will be positioned on-screen.

The term layout describes the process of sizing and positioning the members of a panel element's children collection and then drawing them on-screen. You can obtain a pointer to this collection by calling IXRPanel::GetChildren. To provide support for complex layouts, Silverlight currently implements panel elements such as IXRCanvas, IXRGrid, and IXRStackPanel. IXRGrid is the most flexible and powerful layout element.

In addition to positioning child objects within panel objects, you can also position panel objects within other panel objects. To do this, you must add the child panel object to the object collection. You can retrieve this collection by using the IXRPanel::GetChildren method.

You can access an existing IXRPanel object in the visual tree by obtaining a pointer to a visual host, retrieving the host's root element, traversing the element tree, and then calling IUnknown::QueryInterface on a named object in the visual tree. Or, you can create a new panel element yourself and insert it into a generated visual tree, as an alternative to declaring it in the source XAML for your application.

You can also declare a panel object in Microsoft Silverlight 2 XAML by using the <StackPanel>, <Grid> or <Canvas> XAML elements. Each XAML element represents an object derived from IXRPanel. For information about the differences between XAML in Silverlight for Windows Embedded and Silverlight 2, see Differences Between Silverlight for the Web and Silverlight for Windows Embedded. For more information about how to define this element in the source XAML for your application, see this IXRCanvas, IXRGrid, or IXRStackPanel.

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRPanel

                IXRGrid

                IXRStackPanel

                IXRCanvas

                    IXRInkPresenter

.NET Framework Equivalent

System.Windows.Controls.Panel

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

Classes for UI Element Management