示例#1
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();
            List <Models.Heroes> results;
            var service = new Services.APIService();

            if (HeroesContent.GetHeroes == null)
            {
                results = await service.GetAllHeroes();
            }
            else
            {
                results = HeroesContent.GetHeroes;
            }
            Device.BeginInvokeOnMainThread(() => {
                control = new HeroesResponsiveCollectionView(results);
                Device.StartTimer(TimeSpan.FromSeconds(10), () =>
                {
                    // Do something
                    //System.Diagnostics.Debug.WriteLine("TIMER AFTER 10 SECODS");
                    //pulse.IsEnabled = false;
                    //pulse.IsVisible = false;
                    //pulse.Dispose();
                    contentView.Content = control;
                    return(false); // True = Repeat again, False = Stop the timer
                });
            });
        }
示例#2
0
        void OnScrolled(object sender, ScrolledEventArgs e)
        {
            HeroesResponsiveCollectionView scrollView = sender as HeroesResponsiveCollectionView;
            double scrollingSpace = scrollView.ContentSize.Height - scrollView.Height;
            var    source         = BindableLayout.GetItemsSource(stack) as List <Models.Heroes>;

            //if(source?.Count > 50)
            //return;
            if (scrollingSpace <= e.ScrollY)
            {
                //// Touched bottom
                //// Do the things you want to do
                //if (source.Count >= listCount)
                //    return;
                //System.Diagnostics.Debug.WriteLine($"CHUNCK CURRENT VALUE: {i}");
                //var newList = b[i++];
                //System.Diagnostics.Debug.WriteLine($"CHUNCK NEW VALUE: {i}");
                //_heroesList = source.Concat(newList).ToList();
                //BindableLayout.SetItemsSource(stack, _heroesList);
            }
        }