Partager via


IXRUserControl (Windows Embedded CE 6.0)

1/6/2010

This class provides the base class for defining a new control that encapsulates related existing controls and provides its own logic.

Syntax

class IXRUserControl : public IXRControl

Methods

Method Description

IXRUserControl::GetContent

Retrieves the object that represents the content that is displayed inside this control.

IXRUserControl::SetContent

Sets the object that represents the content to display inside this control.

Remarks

You can create a control that inherits from IXRUserControl to achieve the following goals:

  • To separate functionality into smaller, manageable pieces of logic that can be created independently from an application and from other controls.
  • To group related controls that can be used multiple times in an application.

An IXRUserControl is a composite of existing elements. You can add these elements to an IXRUserControl by calling IXRUserControl::SetContent. Because the parameter that is passed into IXRUserControl::SetContent is an IXRUIElement derived object, you typically set it to an element that inherits from the IXRPanel class. Then, you can populate the child elements of IXRPanel by manipulating its collection object, retrieved by calling IXRPanel::GetChildren.

It is common to put an IXRUserControl inside another IXRUserControl as its content. When you create an IXRUserControl that encapsulates a piece of logic, you will usually position that IXRUserControl as the root element of your Silverlight-based application.

Although IXRUserControl inherits the template-related methods from the IXRControl class, you cannot apply a control template to an IXRUserControl.

You can also define a user control in Microsoft Silverlight 2 XAML. 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 Microsoft Web site.

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRControl

                IXRUserControl

                    IXRCustomUserControlBase

                        IXRCustomUserControl

.NET Framework Equivalent

System.Windows.Controls.UserControl

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