void MarketSurface() { if (!CanStart()) { return; } var control = new DistributeSurfaceControl(); var vm = new DistributeSurfaceViewModel() { IsBusy = true }; control.DataContext = vm; OpenView("Trend Market(" + ProcessMode.ToString() + "):" + GetHeader(), control); Task.Factory.StartNew(() => { try { Save(); var ml = TargetObject.GetMarketDataList(); var tl = TargetObject.GetDistributeTrendByMarket(ml); App.Current.Dispatcher.Invoke(() => { vm.LoadData(tl); }); } catch (Exception ex) { LogSupport.Error(ex); } }).ContinueWith((t) => { vm.IsBusy = false; }); }
void TimeTrend() { if (!CanStart()) { return; } var control = new DistributeTrendControl(); var vm = control.DataContext as DistributeTrendViewModel; vm.IsTimeMode = true; OpenView("Trend Time(" + ProcessMode.ToString() + "):" + GetHeader(), control); Task.Factory.StartNew(() => { Save(); var ml = TargetObject.GetMarketDataList(); var tl = TargetObject.GetDistributeTrendByTime(ml); App.Current.Dispatcher.Invoke(() => { vm.LoadData(tl); }); }).ContinueWith((t) => { vm.IsBusy = false; }); }