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); } }
public async Task Initialize() { await AddDefaultAnimals(); animals = (await backend.GetAnimals()).Select(x => new SimulatedAnimal(x)).ToArray(); }