Beispiel #1
0
 /// <summary>
 /// Initiates subscription to a reactive property.
 /// </summary>
 /// <param name="property">Property to subscribe to.</param>
 /// <param name="subscriber">Subscriber.</param>
 /// <param name="mapper">Function to map the property's data type to the subscriber's.</param>
 /// <returns>Property.</returns>
 public static ReactiveProperty <TSource> SubscribedBy <TSource, TTarget>(this ReactiveProperty <TSource> property,
                                                                          ReactiveProperty <TTarget> subscriber, Func <TSource, TTarget> mapper)
 {
     subscriber.SubscribeTo(property.Select(value => mapper(value)));
     return(property);
 }
Beispiel #2
0
 /// <summary>
 /// Initiates subscription to a reactive property.
 /// </summary>
 /// <param name="property">Property to subscribe to.</param>
 /// <param name="subscriber">Subscriber.</param>
 /// <param name="mapper">Function to map the property's data type to the subscriber's.</param>
 /// <returns>Property.</returns>
 public static ReactiveProperty <TSource> SubscribedBy <TSource, TTarget>(this ReactiveProperty <TSource> property,
                                                                          ReactiveProperty <TTarget> subscriber, Func <IObservable <TSource>, IObservable <TTarget> > mapper)
 {
     subscriber.SubscribeTo(mapper(property));
     return(property);
 }