示例#1
0
 private void ConfigureRx()
 {
     proxy.Observe("onDrag").Delay(TimeSpan.FromMilliseconds(250))
     .Select(tokens => (dynamic)tokens[0])
     .ObserveOnDispatcher()
     .Subscribe(pos =>
     {
         Canvas.SetLeft(myShape2, (double)(pos.X));
         Canvas.SetTop(myShape2, (double)(pos.Y));
     });
 }
示例#2
0
 public static IObservable <T> ObserveAs <T>(this IHubProxy @this, string eventName)
 {
     return(from item in @this.Observe(eventName)
            let m = item[0].ToObject <T>()
                    select m);
 }
 public static IObservable <T> Observe <T>(this IHubProxy proxy, string eventName)
 {
     return(proxy.Observe(eventName).Select(list => Convert <T>(list[0], proxy.JsonSerializer)));
 }