コード例 #1
0
        public override void Init()
        {
            SelectedMarkets.Clear();
            _browseHistory.Clear();

            Browse = BrowseRoot();
        }
コード例 #2
0
        private void RemoveMarket(BrowseMarketModel item)
        {
            SelectedMarkets.Remove(item);

            if (SelectedMarkets.Count == 0)
            {
                _marketId = null;
            }

            ValidateCommand.RaiseCanExecuteChanged();
        }
コード例 #3
0
        private void AddMarket(BrowseMarketModel item)
        {
            var detail = _tradingService.GetMarketDetails(item.Epic);

            if (_marketId == null)
            {
                _marketId = detail.instrument.marketId;
            }

            if (_marketId != detail.instrument.marketId)
            {
                MessageBox.Show($"Add option based on {_marketId} market.", "Wrong market");
                return;
            }

            SelectedMarkets.Add(item);

            ValidateCommand.RaiseCanExecuteChanged();
        }
コード例 #4
0
        private void Validate()
        {
            var mainViewModel = ServiceLocator.Current.GetInstance <MainViewModel>();

            mainViewModel.SimulateOptions(SelectedMarkets.Select(m => m.Epic).ToList());
        }