示例#1
0
        private async Task LoadSymbolViewModel()
        {
            if (symbol == null)
            {
                return;
            }

            SymbolViewModel = new SymbolViewModel(
                userAccount.Exchange, exchangeService, chartHelper,
                orderBookHelperFactory.GetOrderBookHelper(userAccount.Exchange),
                tradeHelperFactory.GetTradeHelper(userAccount.Exchange),
                userAccount.Preferences, Logger)
            {
                Dispatcher = ViewModelContext.UiDispatcher
            };

            ObserveSymbol(SymbolViewModel);

            try
            {
                await SymbolViewModel.SetSymbol(symbol);

                SymbolViewModel.IsActive = true;
            }
            catch (Exception ex)
            {
                TradingViewModelException(ex.ToString(), ex);
            }
        }
示例#2
0
        private async Task LoadSymbolViewModel()
        {
            if (symbol == null)
            {
                return;
            }

            SymbolViewModel = new SymbolViewModel(
                userAccount.Exchange, exchangeService, chartHelper,
                orderBookHelperFactory.GetOrderBookHelper(userAccount.Exchange),
                tradeHelperFactory.GetTradeHelper(userAccount.Exchange),
                userAccount.Preferences, Logger)
            {
                Dispatcher = ViewModelContext.UiDispatcher
            };

            ObserveSymbol(SymbolViewModel);

            await SymbolViewModel.SetSymbol(symbol).ConfigureAwait(true);

            SymbolViewModel.IsActive = true;
        }