public static MvvmHelpers.ObservableRangeCollection <Place> GetPlaces() { var lstPlaces = new MvvmHelpers.ObservableRangeCollection <Place>(); var lstBlocks = new List <string>() { "A", "B" }; int iPlacePerFloor = 4; int iFloors = 12; foreach (string block in lstBlocks) { for (int floor = 1; floor <= iFloors; floor++) { for (int place = 1; place <= iPlacePerFloor; place++) { lstPlaces.Add(new Place() { Block = block, Number = (floor * 10 + place).ToString(), IsSelected = false }); } } } return(lstPlaces); }
public override Task InitializeAsync(object param) { Pokemon = param as Pokemon; Sprites = new MvvmHelpers.ObservableRangeCollection <string>(); var properties = Pokemon.Sprites.GetType().GetProperties(); Sprites.Add(Pokemon.Sprites.FrontDefault); foreach (var property in properties) { var value = property.GetValue(pokemon.Sprites) as string; if (value != null && property.Name != nameof(PokemonSprites.FrontDefault)) { Sprites.Add(value); } } return(Task.CompletedTask); }