private async void ButtonPromeni_Click(object sender, RoutedEventArgs e) { int indeks = GridView1.SelectedIndex; if (indeks > -1) { if (await Validacija()) { Osoba os = listaOsoba[indeks]; os.Ime = TextBoxIme.Text; os.Prezime = TextBoxPrezime.Text; GridView1.ItemsSource = null; GridView1.ItemsSource = listaOsoba; GridView1.SelectedIndex = indeks; GridView1.UpdateLayout(); GridView1.ScrollIntoView(os); await Sacuvaj(); } } else { TextBlock1.Text = "Odaberite osobu."; } }
private async void ButtonUbaci_Click(object sender, RoutedEventArgs e) { if (await Validacija()) { Id++; Osoba os = new Osoba { OsobaId = Id, Ime = TextBoxIme.Text, Prezime = TextBoxPrezime.Text }; listaOsoba.Add(os); GridView1.SelectedIndex = listaOsoba.Count - 1; //GridView1.UpdateLayout(); GridView1.ScrollIntoView(os); await Sacuvaj(); } }