LocalValueEntry 结构

定义

表示本地设置的依赖属性的属性标识符和属性值。Represents a property identifier and the property value for a locally set dependency property.

public value class LocalValueEntry
public struct LocalValueEntry
type LocalValueEntry = struct
Public Structure LocalValueEntry
继承
LocalValueEntry

示例

下面的示例循环访问 DependencyObject 的本地设置的值,并 LocalValueEntry 属性进行查询。The following example iterates locally set values of a DependencyObject and queries LocalValueEntry properties.

void RestoreDefaultProperties(object sender, RoutedEventArgs e)
{
    UIElementCollection uic = Sandbox.Children;
    foreach (Shape uie in uic)
    {
        LocalValueEnumerator locallySetProperties = uie.GetLocalValueEnumerator();
        while (locallySetProperties.MoveNext())
        {
            DependencyProperty propertyToClear = locallySetProperties.Current.Property;
            if (!propertyToClear.ReadOnly) { uie.ClearValue(propertyToClear); }
        }
    }
}
Private Sub RestoreDefaultProperties(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim uic As UIElementCollection = Sandbox.Children
    For Each uie As Shape In uic
        Dim locallySetProperties As LocalValueEnumerator = uie.GetLocalValueEnumerator()
        While locallySetProperties.MoveNext()
            Dim propertyToClear As DependencyProperty = locallySetProperties.Current.Property
            If Not propertyToClear.ReadOnly Then
                uie.ClearValue(propertyToClear)
            End If
        End While
    Next
End Sub

注解

获取 LocalValueEnumeratorCurrent 属性的值时,将返回此类的实例。Instances of this class are returned when getting the value of the Current property of a LocalValueEnumerator. 所有 LocalValueEntry 属性都是只读的。All LocalValueEntry properties are read-only.

此类没有公共构造函数。This class has no public constructor. 若要获取此类的实例,必须调用 GetLocalValueEnumerator,然后从返回的 LocalValueEnumerator获取 Current 的值。In order to obtain instances of this class you must call GetLocalValueEnumerator, and then get the value of Current from the returned LocalValueEnumerator.

属性

Property

获取该条目表示的本地设置的依赖项属性的标识符。Gets the identifier for the locally set dependency property that is represented by this entry.

Value

获取本地设置的依赖属性的值。Gets the value of the locally set dependency property.

方法

Equals(Object)

确定两个 LocalValueEntry 实例是否相等。Determines whether two LocalValueEntry instances are equal.

GetHashCode()

返回此 LocalValueEntry 的哈希代码。Returns the hash code for this LocalValueEntry.

运算符

Equality(LocalValueEntry, LocalValueEntry)

比较指定的 LocalValueEntry 实例,以确定它们是否相同。Compares the specified LocalValueEntry instances to determine whether they are the same.

Inequality(LocalValueEntry, LocalValueEntry)

比较指定的 LocalValueEnumerator 实例,以确定它们是否不同。Compares the specified LocalValueEnumerator instances to determine whether they are different.

适用于

另请参阅