CommandBase GetCurrentValue(ObservableObject observableObject) { try { var value = propertyAccessor.Getter(observableObject); isValueValid = true; return(value); } catch (Exception e) { if (isValueValid) { EventSource.Log.UnableSubsequentlyToReadProperty(propertyAccessor.ObjectTypeName, propertyAccessor.Name, e.ToString()); } isValueValid = false; return(default);
internal ParameterizedCommandValueBag( [NotNull] ObservableObject observableObject, [NotNull] ParameterizedCommandPropertyAccessor propertyAccessor) { this.propertyAccessor = propertyAccessor; try { currentValue = propertyAccessor.Getter(observableObject); isValueValid = true; } catch (Exception e) { EventSource.Log.UnableInitiallyToReadProperty(propertyAccessor.ObjectTypeName, propertyAccessor.Name, e.ToString()); } if (currentValue != null) { currentIsExecuting = currentValue.RunningExecution != null; isIsExecutingValid = true; } }
public override void UpdateNewValue(ObservableObject observableObject) { try { newValue = propertyAccessor.Getter(observableObject); isValueValid = true; } catch (Exception e) { if (isValueValid) { EventSource.Log.UnableSubsequentlyToReadProperty(propertyAccessor.ObjectTypeName, propertyAccessor.Name, e.ToString()); } isValueValid = false; } if (isValueValid && newValue != null) { newIsExecuting = newValue.RunningExecution != null; isIsExecutingValid = true; } }