LocalValueEntry LocalValueEntry LocalValueEntry LocalValueEntry Struct

定義

表示屬性識別項和本機設定相依性屬性的屬性值。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
繼承
LocalValueEntryLocalValueEntryLocalValueEntryLocalValueEntry

範例

下列範例會逐一查看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

備註

取得的Current屬性LocalValueEnumerator值時, 會傳回這個類別的實例。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, 然後Current從傳回LocalValueEnumerator的取得的值。In order to obtain instances of this class you must call GetLocalValueEnumerator, and then get the value of Current from the returned LocalValueEnumerator.

屬性

Property Property Property Property

取得以這個項目表示之本機設定相依性屬性的識別項。Gets the identifier for the locally set dependency property that is represented by this entry.

Value Value Value Value

取得本機設定之相依性屬性的值。Gets the value of the locally set dependency property.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷兩個 LocalValueEntry 執行個體是否相等。Determines whether two LocalValueEntry instances are equal.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個 LocalValueEntry 的雜湊程式碼。Returns the hash code for this LocalValueEntry.

運算子

Equality(LocalValueEntry, LocalValueEntry) Equality(LocalValueEntry, LocalValueEntry) Equality(LocalValueEntry, LocalValueEntry) Equality(LocalValueEntry, LocalValueEntry)

比較指定的 LocalValueEntry 執行個體,判斷它們是否相同。Compares the specified LocalValueEntry instances to determine whether they are the same.

Inequality(LocalValueEntry, LocalValueEntry) Inequality(LocalValueEntry, LocalValueEntry) Inequality(LocalValueEntry, LocalValueEntry) Inequality(LocalValueEntry, LocalValueEntry)

比較指定的 LocalValueEnumerator 執行個體,判斷它們是否不同。Compares the specified LocalValueEnumerator instances to determine whether they are different.

適用於

另請參閱