protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); lstPhotographers.ItemsSource = null; if (e.Parameter != null) { if (e.Parameter.GetType() == typeof(int)) { int id = (int)e.Parameter; show = await Shows.Get(id); txtFecha.Date = show.Fecha.Value; txtBandaArtista.SelectedValue = show.ArtistaId; txtLugar.SelectedValue = show.LugarId; lstPhotographers.ItemsSource = null; lstPhotographers.ItemsSource = show.Fotografos; //LoadData(id); } } else { show = new Show(); show.Id = 0; txtFecha.Date = DateTime.Now; txtBandaArtista.SelectedIndex = -1; txtLugar.SelectedIndex = -1; } //Verify GoBack Method var cParameter = CloureManager.GetParameter(); if (cParameter != null) { if (cParameter.GetType() == typeof(CloureParam)) { CloureParam cloureParam = (CloureParam)cParameter; if (cloureParam.name == "place_id") { LoadPlaces((int)cloureParam.value); } if (cloureParam.name == "artist_id") { LoadBandArtists((int)cloureParam.value); } } else if (cParameter.GetType() == typeof(ObservableCollection <User>)) { fotografos = (ObservableCollection <User>)cParameter; show.Fotografos = fotografos; lstPhotographers.ItemsSource = null; lstPhotographers.ItemsSource = fotografos; } } }
private async void LoadData(int id) { show = await Shows.Get(id); txtFecha.Date = show.Fecha.Value; txtBandaArtista.SelectedValue = show.ArtistaId; txtLugar.SelectedValue = show.LugarId; lstPhotographers.ItemsSource = null; lstPhotographers.ItemsSource = show.Fotografos; //lstPhotographers.ItemsSource = fotografos; }