/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IStockProvider dataService) { _dataService = dataService; BVM = new BasicViewModel(dataService); GVM = new GroupViewModel(dataService); GHVM = new GroupHistoryViewModel(dataService); var loStreamQuote = _dataService.StockQuoteStream.ObserveOnDispatcher() .Scan((quoteA, quoteB) => StockQuote.MinPrice(quoteA, quoteB)).DistinctUntilChanged(); var hiStreamQuote = _dataService.StockQuoteStream.ObserveOnDispatcher() .Scan((quoteA, quoteB) => StockQuote.MaxPrice(quoteA, quoteB)).DistinctUntilChanged(); loStreamQuote.Subscribe(quote => LoQuote = quote); hiStreamQuote.Subscribe(quote => HiQuote = quote); }