Поделиться через


IXRContentPresenter (Compact 2013)

3/28/2014

This class represents how to display content inside a control.

Syntax

class IXRContentPresenter : public IXRControl

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRControl

                IXRContentPresenter

Methods

Method

Description

IXRContentPresenter::GetContent

Retrieves the object that represents the content to display inside this content presenter.

IXRContentPresenter::GetContentTemplate

Retrieves the object that represents the data template used to display the content inside this control.

IXRContentPresenter::SetContent

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

IXRContentPresenter::SetContentTemplate

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

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

A content presenter can be used to specify positioning information, such as how control contents are aligned horizontally or vertically.

You can access an IXRContentPresenter object in the control template of a control.

When you create a class instance, use an IXRContentPresenterPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

This object is declared in the source Silverlight 3 XAML for your application. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the ContentPresenter Class on MSDN.

After you parse the source XAML into a visual tree, you can access this object in the visual tree by finding the object by name, obtaining an IXRControl pointer on a control, and calling the IXRControl::GetTemplate method to obtain an IXRControlTemplate pointer to its control template. This pointer provides access to the element subtree for that control template.

.NET Framework Equivalent

System.Windows.Controls.ContentPresenter

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management