Ejemplo n.º 1
0
        private async void LoadLists()
        {

            StatusBar bar = StatusBar.GetForCurrentView();
            await bar.ProgressIndicator.ShowAsync();
            bar.ProgressIndicator.Text = "Getting Queue";
            await bar.ShowAsync();

            //Execute commands before loading
            await api.executeCommands();
            
            //Load Queue
            q = new Queue();
            queue.ItemsSource = q;
            await q.download();
            

            bar.ProgressIndicator.Text = "Getting Calendar";

            List<Episode> cal = await api.getCalendar();
            if (cal != null)
            {
                var result =
                    from ep in cal
                    group ep by ep.airdate
                    into grp
                    orderby grp.Key
                    select grp;
                calendar.Source = result;
            }


            bar.ProgressIndicator.Text = "Getting Tracker";

            //Load Tracker
            Tracker trackerO = new Tracker();
            tracker.ItemsSource = trackerO.getTracker();
            await trackerO.load();

            foreach (TvShow show in trackerO.getTracker())
            {
                imageLoader.Source = show.Image;
            }

            bar.ProgressIndicator.Text = "Done";
            await bar.HideAsync();

            SharedCode.Memory.store(q);
            SharedCode.Memory.store(trackerO);
            SharedCode.Memory.store(cal);
        }