Grid CreateCell(QueueDownload queue) { var grid = new Grid() { ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(10, GridUnitType.Star) }, }, RowDefinitions = { new RowDefinition { Height = new GridLength(10, GridUnitType.Star) }, } }; var lbl = new Label() { Text = queue.Text }; var pgr = new ProgressBar() { Progress = Items.Count * 25 }; grid.Children.Add(lbl); grid.Children.Add(pgr); return(grid); }
public async Task AddDownloadToQueue(string path) { var name = new FileInfo(path.Replace("\\", "/")).Name; var item = new QueueDownload(name, path); await AddQueueItem(item); }
async Task AddQueueItem(QueueDownload item) { Items.Add(item); await Device.InvokeOnMainThreadAsync(() => { list.ItemsSource = null; list.ItemsSource = Items; }); }