Beispiel #1
0
        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);
        }
Beispiel #2
0
        public async Task AddDownloadToQueue(string path)
        {
            var name = new FileInfo(path.Replace("\\", "/")).Name;
            var item = new QueueDownload(name, path);

            await AddQueueItem(item);
        }
Beispiel #3
0
 async Task AddQueueItem(QueueDownload item)
 {
     Items.Add(item);
     await Device.InvokeOnMainThreadAsync(() => { list.ItemsSource = null; list.ItemsSource = Items; });
 }