public ClipBoardWatcherViewViewModel(ISampleAppData sampleAppData) { this.appData = sampleAppData; this.ClipBoardDatas = this.appData.Stocks .ToReadOnlyReactiveCollection(d => new WatchedClipBoardDataViewModel(d)) .AddTo(this.disposables); }
public FileWatcherViewViewModel(ISampleAppData sampleAppData, IRegionManager regionMan) { this.appData = sampleAppData; this.regionManager = regionMan; this.WatchedFiles = this.appData.WatchedFiles .ToReadOnlyReactiveCollection(f => new WatchedFileViewModel(f)) .AddTo(this.disposables); this.WatchedFiles.ObserveAddChanged() .Subscribe(_ => this.regionManager.RequestNavigate("ContentRegion", "FileWatcherView")); }
public MainWindowViewModel(ISampleAppData sampleAppData, IRegionManager regionMan) { this.regionManager = regionMan; this.appData = sampleAppData; this.ClipBoardCommand = new ReactiveCommand() .WithSubscribe(() => { this.seqCount++; this.appData.AddToClipboard(this.seqCount); }) .AddTo(this.disposables); this.ClosedCommand = new ReactiveCommand() .WithSubscribe(() => this.Dispose()) .AddTo(this.disposables); this.appData.Stocks.CollectionChanged += (s, e) => this.regionManager.RequestNavigate("ContentRegion", "ClipBoardWatcherView"); }