Example #1
0
        public void AddValue <T>(string name, ObservableValue <T> observableValue)
        {
            _valueGetters.Add(name, () => observableValue.Latest);
            _valueSetters.Add(name, value => observableValue.OnNext((T)value));

            _subscriptions.Add(observableValue.Subscribe(_ => _propertyChanged.OnNext(name)));
        }
Example #2
0
 /// <summary>
 /// Makes an <see cref="ObservableValue{T}"/> accessible via data-binding to
 /// any control.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="name"></param>
 /// <param name="observableValue"></param>
 public static void AddGlobalProperty <T>(string name, ObservableValue <T> observableValue)
 {
     __globalValues.AddValue(name, observableValue);
 }
Example #3
0
 /// <summary>
 /// Makes an <see cref="ObservableValue{T}"/> accessible via data-binding.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="name"></param>
 /// <param name="observableValue"></param>
 public void AddProperty <T>(string name, ObservableValue <T> observableValue)
 {
     _localValues.AddValue(name, observableValue);
 }