Value Property
Collapse the table of content
Expand the table of content

Setter.Value Property


Gets or sets the value to apply to the property that is specified by this Setter.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

[LocalizabilityAttribute(LocalizationCategory.None, Readability = Readability.Unreadable)]
public object Value { get; set; }

Property Value

Type: System.Object

The default value is UnsetValue.

Exception Condition

If the specified Value is set to UnsetValue.

<object Value="value"/>



An object or a markup extension. See StaticResource Markup Extension.

Note that you must specify both the Property and Value properties on a Setter or an exception will be thrown.

Data binding and dynamic resources within the object is supported if the specified value is a Freezable object. See Binding Markup Extension and DynamicResource Markup Extension.

The following example defines a Style that will be applied to every TextBlock element. For the complete example, see Introduction to Styling and Templating Sample.

The following example defines a Style with Setters that reference system resources.

The following example defines a Style for the RepeatButton.

The following example shows a Value property that uses the Binding declaration. For the complete example, see Binding Validation Sample.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft