async void AgregarVegetal() { IsRefreshing = true; Vegetales.Add(new Vegetal() { DetalleVegetal = "", SuperficieVegetal = "", CategoriaVegetal = "", }); HeighListViewVegetal = HeighListViewVegetal + 44; IsRefreshing = false; }
async private void LoadVegetales() { if (Application.Current.Properties.ContainsKey("ContadorVegetales")) //contador de la cantidad de elementos en la lista { ElementosVegetal = int.Parse((Application.Current.Properties["ContadorVegetales"]) as string); } else { ElementosVegetal = 0; } IsRefreshing = true; for (int j = 0; j < ElementosVegetal; j++) //Elementos va a representar el total de elementos o filas existentes en mi persistencia { if (Application.Current.Properties.ContainsKey("DetalleVegetal" + j)) { detallevegetal = (Application.Current.Properties["DetalleVegetal" + j]) as string; } else { detallevegetal = ""; } if (Application.Current.Properties.ContainsKey("SuperficieVegetal" + j)) { superficievegetal = (Application.Current.Properties["SuperficieVegetal" + j] as string); } else { superficievegetal = ""; } if (Application.Current.Properties.ContainsKey("CategoriaVegetal" + j)) { categoriavegetal = (Application.Current.Properties["CategoriaVegetal" + j] as string); } else { categoriavegetal = ""; } Vegetales.Add(new Vegetal() //agrega a mi lista todos los elementos existentes en persistencia { CategoriaVegetal = categoriavegetal, DetalleVegetal = detallevegetal, SuperficieVegetal = superficievegetal, }); } IsRefreshing = false; HeighListViewVegetal = 44 * Vegetales.Count; //cantidad de filas en mi lista, multiplicado por 44 que es el alto maximo de cada fila }