Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

DependencyObject.ReadLocalValue Method

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

Namespace: System.Windows
Assembly: WindowsBase (in windowsbase.dll)

public Object ReadLocalValue (
	DependencyProperty dp
)
public Object ReadLocalValue (
	DependencyProperty dp
)
public function ReadLocalValue (
	dp : DependencyProperty
) : Object
You cannot use methods in XAML.

Parameters

dp

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

Return Value

Returns the local value, or returns the UnsetValue if no local value is set.

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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.