public async void Refresh() { foreach (var item in Portfaills) { JobsStatusSend?.Invoke($"Load {item.Account_Id} Portfolio stocks"); item.FromTinkoff_stock(await Static_info.CurrentContext.PortfolioAsync(item.Account_Id)); JobsStatusSend?.Invoke($"Load {item.Account_Id} Portfolio Money"); item.Currencies_list = (await Static_info.CurrentContext.PortfolioCurrenciesAsync(item.Account_Id)).Currencies; } }
public async Task doLoad() { try { JobsStatusSend?.Invoke("Load Account"); var aa = await Static_info.CurrentContext.AccountsAsync(); foreach (var item in aa) { Portfaills.Add(new Portfaill(item.BrokerAccountId, item.BrokerAccountType)); } Refresh(); JobsStatusSend?.Invoke("Done"); JobsDone?.Invoke(true); } catch (Exception ex) { JobsDone?.Invoke(false, ex.Message); } }