private async Task Update(List <PortfolioItem> items, ChartRange range) { ProgressRing.IsActive = true; PortfolioGrid.ItemsSource = null; using (var iexCloudClient = IEXCloudService.GetClient()) { foreach (var item in items) { // Needs to be inside the loop. // The IEXSharp ExecutorREST helper changes the QueryStringBuilder and blocks reuse. var queryStringBuilder = new IEXSharp.Helper.QueryStringBuilder(); queryStringBuilder.Add("chartCloseOnly", "true"); queryStringBuilder.Add("chartSimplify", "true"); var response = await iexCloudClient.StockPrices.HistoricalPriceAsync(item.Symbol, range, queryStringBuilder); if (response.ErrorMessage != null) { Console.WriteLine(response.ErrorMessage); } else { item.HistoricalPrices = response.Data; } } } PortfolioGrid.ItemsSource = items; await Task.Delay(1000); // Give the GridView some time to render the containers. PortfolioGrid.RegisterImplicitAnimations(); ProgressRing.IsActive = false; }
public override void Load(SettingsStorage settings) { PortfolioGrid.Load(settings.GetValue <SettingsStorage>("PortfolioGrid")); }
public override void Save(SettingsStorage settings) { settings.SetValue("PortfolioGrid", PortfolioGrid.Save()); }