示例#1
0
        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;
        }
示例#2
0
        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();
            }
        }