コード例 #1
0
        public MainWindowViewModel()
        {
            Log.Info("Application started");

            DependencyContainer.ComposeParts(this);

            _strategiesDirectory = Path.Combine(_dataDirectoryService.MainDirectoryWithApplicationName);

            // Setup brokers
            var brokers = new IBroker[]
            {
                _fxcm = new FxcmBroker
                {
                    IncludeReportInUpdates = false
                }
            };

            _brokersService.AddBrokers(brokers);

            RunStrategyLiveViewModel = new RunStrategyLiveViewModel();

            LoginOutViewModel = new LoginOutViewModel();

            RefreshStrategyFilenames();
        }
コード例 #2
0
        public MainWindowsViewModel()
        {
            DependencyContainer.ComposeParts(this);

            _dispatcher = Dispatcher.CurrentDispatcher;

            UpdateFXCandlesCommand = new DelegateCommand(UpdateFXCandles);

            var brokers = new IBroker[]
            {
                new FxcmBroker(),
                new BinanceBroker("TODO", "TODO"), 
            };

            // Setup brokers and load accounts
            _brokersService.AddBrokers(brokers);

            EventManager.RegisterClassHandler(typeof(Window), Keyboard.KeyDownEvent, new KeyEventHandler(UIElement_OnPreviewKeyDown), true);
            LoginOutViewModel = new LoginOutViewModel();
        }