Example #1
0
        private async Task LoadAnimals()
        {
            try
            {
                Items.Value = await backend.GetAnimals();

                if (Items.Value != null && !animalLoaded)
                {
                    foreach (var item in Items.Value)
                    {
                        if (item.Owner == "JunctionX")
                        {
                            MyAnimalsViewModel.AddAnimal(item);
                        }
                    }
                    animalLoaded = true;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #2
0
        public async Task Initialize()
        {
            await AddDefaultAnimals();

            animals = (await backend.GetAnimals()).Select(x => new SimulatedAnimal(x)).ToArray();
        }