Partager via


IXRControlTemplate::SetTargetType (Windows Embedded CE 6.0)

1/6/2010

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 user-defined 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_CustomList.

You must supply the IID that you created for the custom control and registered by using the XRCustomUserControl<IFace,Derived>::Register method.

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

The controls available in Silverlight 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
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

IXRControlTemplate
IXRControlTemplate::GetTargetType