Esempio n. 1
0
        public async Task RefreshApi()
        {
            //czysci kolekcje

            RecepiesesColection.Clear();
            pageNumber = 1;

            var recepies = await ApiService.GetAllRecepiesPartial(1, 5);

            foreach (var recepie in recepies)
            {
                RecepiesesColection.Add(recepie);
            }

            //refresh user name
            this.userName = Preferences.Get("userName", String.Empty);


            IsRefreshing = false;
        }
Esempio n. 2
0
        public async Task GetAll()
        {
            try
            {
                //refresh user name
                this.userName = Preferences.Get("userName", String.Empty);
                pageNumber++;

                var recepies = await ApiService.GetAllRecepiesPartial(pageNumber, 5);

                if (recepies.Count == 0)
                {
                    pageNumber--;
                }
                foreach (var recepie in recepies)
                {
                    RecepiesesColection.Add(recepie);
                }
            }
            catch (Exception e)
            {
            }
        }