다음을 통해 공유


DomainPropertyValueHandler<TElement,TValue>.OnValueChanged Method

Definition

Called after property value has been changed.

protected:
 virtual void OnValueChanged(TElement element, TValue oldValue, TValue newValue);
protected virtual void OnValueChanged (TElement element, TValue oldValue, TValue newValue);
abstract member OnValueChanged : 'Element * 'Value * 'Value -> unit
override this.OnValueChanged : 'Element * 'Value * 'Value -> unit
Protected Overridable Sub OnValueChanged (element As TElement, oldValue As TValue, newValue As TValue)

Parameters

element
TElement

Element which owns the property.

oldValue
TValue

Old value of the property.

newValue
TValue

New value of the property.

Examples

protected override void OnValueChanged(ElementClassType element, FieldType oldValue, FieldType newValue) { // call the base class implementation first base.OnValueChanged(element, oldValue, newValue); if (element.Store.InUndoRedoOrRollback) { // your undo/redo only code goes here // you cannot make model changes here. // You can only change out-of-model state } else { // your non-undo/redo only code goes here // All your model changes should be done here. // You should not make any out-of-model state changes // here because it will not be in sync after undo/redo } // your other code goes here // you cannot make model changes here. You can only change // out-of-model state. }

Applies to