Share via


DependencyPropertyChangedEventArgs.OldValue 屬性

定義

取得報告變更之前相依性屬性的值。

public:
 property Platform::Object ^ OldValue { Platform::Object ^ get(); };
IInspectable OldValue();
public object OldValue { get; }
var object = dependencyPropertyChangedEventArgs.oldValue;
Public ReadOnly Property OldValue As Object

屬性值

Object

Platform::Object

IInspectable

變更之前的相依性屬性值。

備註

OldValue 值通常用來作為屬性在回呼內設定為 的值,以防 NewValue 值不會被視為屬性邏輯的有效值。 例如,如果您使用回呼來驗證使用者可在 UI 中設定之屬性的輸入值,則先前的值通常是使用做為目前值,而不是將值重設為預設值。 回呼會有效地取消變更。

適用於

另請參閱