Partager via


IXRFrameworkElement::SetStyle (Windows Embedded CE 6.0)

1/6/2010

This method sets an IXRStyle instance that is applied to this framework element when it is displayed.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetStyle(
    IXRStyle *pStyle
) = 0; 

Parameters

  • pStyle
    [in] Pointer to an IXRStyle object that references the new applied style for this element.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

Setting the applied style directly by using an IXRStyle object is not the most common way to apply a style to an element in Silverlight. You can apply a style to any element that inherits from IXRFrameworkElement. However, you can also apply a control template to elements that inherit from the derived class IXRControl by setting an IXRControlTemplate object for the element. It is more common to set the appearance of an element through one of the following cases:

  • Control developers can write a control that is based on IXRControl that is templatable. Then, applications that use the control can change its appearance by setting a new IXRControlTemplate object for it.
  • UI designers can define a default style in XAML that Silverlight applies to all instances of the control.

.NET Framework Equivalent

System.Windows.FrameworkElement.Style

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

IXRFrameworkElement
IXRFrameworkElement::GetStyle