public object GetValue(ValueNode target) { if (IsConst) { return(_constValue); } var source = GetSource(target); return(Convert(source.Value, target.CreateSerializationContext())); }
public void Bind(ValueNode target, Func <object> callback) { if (IsConst) { return; } var source = GetSource(target); source.TargetBindings.Add(() => ConvertBack(callback(), target.CreateSerializationContext())); }
public object GetBoundValue(ValueNode target) { if (IsConst) { return(_constValue); } var source = GetSource(target); var bindingSource = source as IBindingSource; if (bindingSource == null) { throw new InvalidOperationException("Not a bindable source."); } return(Convert(bindingSource.BoundValue, target.CreateSerializationContext())); }