protected override void OnStartup(StartupEventArgs e) { var context = GetDispatcherContext(); var runner = new GapTraderRunner(context); Window window = new GapTraderMainWindow(); window.Show(); var mainViewModel = new GapTraderMainViewModel(runner); window.DataContext = mainViewModel; }
private void OnProcessButtonClick(object sender, RoutedEventArgs e) { var runner = new GapTraderRunner(GetDispatcherContext()); if (DailyDataFileNameTextBox.Text == string.Empty && !DeriveFromDaily.IsChecked == true) { runner.Run(this, new Message("", "Select Daily Data File or Derive From Minute Data", Message.MessageType.Error)); } else if (BidMinuteDataFileNameTextBox.Text == string.Empty || AskMinuteDataFileNameTextBox.Text == string.Empty) { runner.Run(this, new Message("", "Select Minute Data Files", Message.MessageType.Error)); } else { var vm = (DataUploaderViewModel)DataContext; vm.StartUploadCommand.Execute(null); Close(); } }