private bool OnApplyingState(string property, ref object value) { var handler = ApplyingProperty; if (handler != null) { TrackingOperationEventArgs args = new TrackingOperationEventArgs(this, property, value); handler(this, args); value = args.Value; return(!args.Cancel); } else { return(true); } }
private object OnPersistingState(string property, object value) { var handler = PersistingProperty; if (handler != null) { TrackingOperationEventArgs args = new TrackingOperationEventArgs(this, property, value); handler(this, args); if (args.Cancel) { throw new OperationCanceledException(); } else { return(args.Value); } } return(value); }