FrameworkElement.Style property

Expand
This topic has not yet been rated - Rate this topic

FrameworkElement.Style property

[This documentation is preliminary and is subject to change.]

Gets or sets an instance Style that is applied for this object during rendering.

Syntax


public Style Style { get; set; }


<frameworkElement Style="{StaticResource styleResourceKey}"/>

XAML Values

styleResourceKey

The key that identifies the style being requested. The key refers to an existing resource in a ResourceDictionary.

Note  XAML property element syntax to define an inline style is technically possible, but not recommended for setting FrameworkElement.Style. This is because any property set through a single-use inline style could just as easily have been set by directly setting the property as a XAML attribute (or property element). Defining a one-use style to set that same property is generally poor markup style and can cause a confusing run-time property setting behavior.

Property value

Type: Style

The applied style for the object, if present; otherwise, null. The default for a default-constructed FrameworkElement is null.

Requirements

Minimum supported client

Windows 8 Release Preview

Minimum supported server

Windows Server 2012

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.winmd

See also

FrameworkElement

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD