public override void Init() { SelectedMarkets.Clear(); _browseHistory.Clear(); Browse = BrowseRoot(); }
private void RemoveMarket(BrowseMarketModel item) { SelectedMarkets.Remove(item); if (SelectedMarkets.Count == 0) { _marketId = null; } ValidateCommand.RaiseCanExecuteChanged(); }
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(); }
private void Validate() { var mainViewModel = ServiceLocator.Current.GetInstance <MainViewModel>(); mainViewModel.SimulateOptions(SelectedMarkets.Select(m => m.Epic).ToList()); }