public DashboardViewModelCore(DustService dustService = null, ExcelGenerator excelGenerator = null, IScreen screen = null)
        {
            _excelGenerator = excelGenerator ?? Locator.Current.GetService <ExcelGenerator>();
            _dustService    = dustService ?? Locator.Current.GetService <DustService>();
            HostScreen      = screen ?? Locator.Current.GetService <IScreen>();

            var canLoadDataCommand = this.WhenAnyValue(p => p.SelectedStation)
                                     .Select(p => p != null);

            LoadDataCommand = ReactiveCommand.CreateFromObservable <Station, Record[]>(station =>
            {
                //Info = new DashboardInfo();
                _values.Clear();

                IObservable <Record[]> s = _dustService.GetAvailableParametersAsync(station)
                                           .Select(@params => @params.Select(p => p.Param).ToArray())
                                           .Select(@params => _dustService.GetStationRecordsAsync(station.Code, @params)).Switch();

                return(Observable.Start(() => s, RxApp.TaskpoolScheduler).Switch().TakeUntil(CancelCommand));;
            }, canLoadDataCommand);

            CancelCommand = ReactiveCommand.Create(
                () => { },
                this.LoadDataCommand.IsExecuting);

            this.WhenActivated(cleanup =>
            {
                var share = _values.Connect().Publish().RefCount();
                share.ToCollection().Select(records =>
                {
                    return(Enum.GetValues(typeof(RecordType)).Cast <RecordType>()
                           .Select(type => records.LastOrDefault(r => r.Type == type)));
                }).BindTo(this, vm => vm.LastRecords).DisposeWith(cleanup);

                share.Bind(StationData).Subscribe().DisposeWith(cleanup);

                LoadDataCommand.ThrownExceptions.Subscribe(ShowError).DisposeWith(cleanup);

                LoadDataCommand.Subscribe(records =>
                {
                    _values.Edit(e => e.AddRange(records));
                }).DisposeWith(cleanup);

                var canSaveToExcelCommand = StationData.ObserveCollectionChanges().Select(_ => StationData.Count > 0);

                SaveToExcelCommand = ReactiveCommand.CreateFromTask <IEnumerable <Record> >(data => _excelGenerator.CreateExcel(SelectedStation.Code, data), canSaveToExcelCommand);

                SaveToExcelCommand.ThrownExceptions.Subscribe(ShowError);

                this.WhenAnyValue(p => p.SelectedStation).Where(p => p != null).Do(_ => CancelCommand.Execute().Subscribe()).InvokeCommand(LoadDataCommand).DisposeWith(cleanup);;
            });
        }