Share via


IXRStyle::SetBasedOn (Compact 2013)

3/28/2014

This method sets a defined style that is the basis of the current style.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetBasedOn(
    __in IXRStyle* pBasedOn
) = 0;

Parameters

  • pBasedOn
    [in] Pointer to an IXRStyle object that specifies an existing style to set as the basis of the current style. The default value is null.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

Each style can be based on only one other style. You cannot use the SetBasedOn method after a style is sealed. A style's TargetType property must match or be derived from the TargetType of the base style. You can set the TargetType property by calling the IXRStyle::SetTargetType method.

A style is sealed either when the IXRStyle::Seal method is called or when the style is applied to an object derived from IXRFrameworkElement. When a style is sealed, all the base styles it derives from up the inheritance chain are also sealed.

When the style you are working with and the style it is based on have the same property, the property value set in the style you are working with is the one that is used.

A style cannot be based on itself, or on any style that derives from it down the inheritance chain.

.NET Framework Equivalent

System.Windows.Style.BasedOn

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRStyle