Skip to main content
.NET Framework Class Library
DependencyObjectReadLocalValue Method

Returns the local value of a dependency property, if it exists.

Namespace:   System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)
Syntax
Public Function ReadLocalValue ( _
	dp As [%$TOPIC/ms597472_en-us_VS_110_1_0_0_0_0%] _
) As [%$TOPIC/ms597472_en-us_VS_110_1_0_0_0_1%]
public [%$TOPIC/ms597472_en-us_VS_110_1_0_1_0_0%] ReadLocalValue(
	[%$TOPIC/ms597472_en-us_VS_110_1_0_1_0_1%] dp
)
public:
[%$TOPIC/ms597472_en-us_VS_110_1_0_2_0_0%]^ ReadLocalValue(
	[%$TOPIC/ms597472_en-us_VS_110_1_0_2_0_1%]^ dp
)
member ReadLocalValue : 
        dp:[%$TOPIC/ms597472_en-us_VS_110_1_0_3_0_0%] -> [%$TOPIC/ms597472_en-us_VS_110_1_0_3_0_1%]

Parameters

dp
Type: System.WindowsDependencyProperty

The DependencyProperty identifier of the property to retrieve the value for.

Return Value

Type: SystemObject
Returns the local value, or returns the sentinel value UnsetValue if no local value is set.
Remarks

You should use GetValue for most typical "get" operations for a dependency property. ReadLocalValue does not return the effective value for a variety of circumstances where the value was not locally set.

Values that are set by styles, themes, templates, the default value from metadata, or property value inheritance are not considered to be local values. However, bindings and other expressions are considered to be local values, after they have been evaluated.

When no local value is set, this method returns UnsetValue.

If the returned value is other than UnsetValue, you can query the metadata of the requested dependency property to determine whether there is a more specific type that the return value can be converted to.

Version Information

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.