DomainPropertyValueHandler<TElement,TValue>.OnValueChanging 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当属性值将要更改时调用。
protected:
virtual void OnValueChanging(TElement element, TValue oldValue, TValue newValue);
protected virtual void OnValueChanging (TElement element, TValue oldValue, TValue newValue);
abstract member OnValueChanging : 'Element * 'Value * 'Value -> unit
override this.OnValueChanging : 'Element * 'Value * 'Value -> unit
Protected Overridable Sub OnValueChanging (element As TElement, oldValue As TValue, newValue As TValue)
参数
- element
- TElement
拥有该属性的元素。
- oldValue
- TValue
属性的旧值。
- newValue
- TValue
属性的新值。
示例
protected override void OnValueChanging (ElementClassType 元素、FieldType oldValue、FieldType newValue) {//调用基类实现第一个基。OnValueChanging (元素,oldValue,newValue) ;如果 (元素。InUndoRedoOrRollback) {//您的撤消/重做操作仅在此处//不能在此处进行模型更改。 只能更改不在模型中的状态} else {//您的非撤消/重做操作此处//所有模型更改都应在此处进行。 不应进行任何模型外状态更改//此处,因为它不会在撤消/重做后保持同步}//其他代码在此处进行,也不能在此处进行模型更改。 只能更改//模型状态。 }