protected async override void OnPublished(object data) { if (isOpen) { return; } IsBusy = true; if (Messages != null && Messages.Any()) { ClearMessages(); } accountViewModel.Dispatcher = ViewModelContext.UiDispatcher; symbolsViewModel.Dispatcher = ViewModelContext.UiDispatcher; tradeViewModel.Dispatcher = ViewModelContext.UiDispatcher; ordersViewModel.Dispatcher = ViewModelContext.UiDispatcher; Account = new Account(new Core.Model.AccountInfo { User = new Core.Model.User() }); try { userAccount = await accountsService.GetAccountAsync(Title); var json = JsonConvert.SerializeObject(userAccount, Formatting.Indented); Logger.Log(json, Category.Info, Priority.Medium); } catch (Exception ex) { TradingViewModelException(ex.ToString(), ex); } if (userAccount != null && userAccount.Preferences != null) { if (!string.IsNullOrWhiteSpace(userAccount.ApiKey)) { Account.AccountName = userAccount.AccountName; Account.ApiKey = userAccount.ApiKey; Account.ApiSecret = userAccount.ApiSecret; Account.ApiPassPhrase = userAccount.ApiPassPhrase; Account.Exchange = userAccount.Exchange; } } await Task.WhenAll(SymbolsViewModel.SetAccount(userAccount), AccountViewModel.Login(Account)); isOpen = true; IsBusy = false; }