Partager via


IXRContentControl::SetContent (Compact 2013)

3/28/2014

This method sets the object that represents the content that is displayed inside this control.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetContent(
    __in XRValue* pContent
) = 0;

Parameters

  • pContent
    [in] Pointer to an XRValue object that represents the new content that is displayed inside this control.

Return Value

Returns an HRESULT that indicates success or failure.

Returns XR_E_INVALID_OBJECT if pContent is not a XAML for Windows Embedded object.

Remarks

The pContent parameter can be any kind of object, such as a text string, or an object derived from IXRUIElement. The IXRContentControl object displays its content on the screen, inside its bounding frame. When pContent is set to an object derived from IXRUIElement, the object is displayed inside the content control. When pContent is set to another kind of object, a string representation of the object is displayed inside the content control.

To set pContent to NULL, use the following syntax:

pControl->SetContent((XRValue*)NULL);

To use any supported value type, such as a float value, you can use the helper template version of this method that XAML for Windows Embedded provides. When you supply a value type, this version automatically supplies a type-safe method that implicitly converts the returned type from a generic XRValue to the appropriate data type.

.NET Framework Equivalent

System.Windows.Controls.ContentControl.Content

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRContentControl
IXRContentControl::GetContent