次の方法で共有


IXRControlTemplate::SetTargetType (Compact 2013)

3/28/2014

This method sets the object type to which this control template is applied.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetTargetType(
    const IID iid
) = 0;

Parameters

  • iid
    [in] Interface identifier (IID) of the object type to which this control template is applied.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

You can apply an existing control template to a control that derives from IXRControl by setting the target type as the IID for any of those derived objects.

The IID you specify in iiD is the name of an object that inherits from IXRControl, prefixed with the substring "IID_". For example, IID_IXRButton.

You must call this method before you call IXRControl::SetTemplate on the target control to apply this template.

The controls available in XAML for Windows Embedded each have default control templates set in the generic.xaml source file. You can retrieve the control template set for a control by calling IXRControl::GetTemplate.

After you set the target type and apply the control template, you can add the new control to a collection in the visual tree.

.NET Framework Equivalent

System.Windows.Controls.ControlTemplate.TargetType

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRControlTemplate
IXRControlTemplate::GetTargetType