this may remedial question, research spinning me in circles right (especially java developer) , looking @ several different rx wrapper libraries. want take listview<musicnote>.selecteditem
, wrap iobservable
, emitting stream of current single selected value. easiest means this? should use reactiveproperty, rx-xaml, or library? or there easy built-in way rx.net? prefer not use traditional event method stub vs generates. although push values in that, feels messy , not paradigm want.
this.keyselector.selecteditem // turn listview's selecteditem iobservable
one way of doing in rx.net following:
var whenselectionchange = observable.fromeventpattern(h => listview.selectedindexchanged += h, h => listview.selectedindexchanged -= h) .select(_ => listview.selecteditem);
basically, fromeventpattern() generates observable sequence selectedindexchanged events triggered listview. select() called each time event triggered, can selected index list , return it. whenselectionchange iobservable<int>
each added element new selected index.
i have never used it, can take @ http://reactiveui.net/ it's mvvm framework seems integrate rx.net , supported on mobile platforms.
Comments
Post a Comment