/// <summary> /// Update the property value within a transaction context /// </summary> /// <param name="updateCallback"></param> private void UpdatePropertyValue(UpdatePropertyValueCallback updatePropertyValueCallback, string txName) { try { PropertyWindowViewModelHelper.CreateCommandProcessorContext(_editingContext, txName); updatePropertyValueCallback(); } finally { PropertyWindowViewModelHelper.RemoveCommandProcessorContext(); } }
internal void BeginPropertyValueUpdate(EditingContext editingContext, string transactionName) { if (_cpc == null) { Debug.Assert(_counter == 0, "CommandProcessorContext is null when counter value is not 0?"); if (_counter == 0) { _cpc = PropertyWindowViewModelHelper.CreateCommandProcessorContext(editingContext, transactionName); _cpc.EditingContext.ParentUndoUnitStarted = true; _cpc.Artifact.XmlModelProvider.BeginUndoScope(transactionName); } } }