private void B_Contex_Add_Click(object sender, RoutedEventArgs e) { Dialogs.EditListOfChannelsAdd elc = new Dialogs.EditListOfChannelsAdd(); var result = elc.ShowDialog(); if (result != null && result == true) { if (elc.NewChannel != "") { var kek = (List <string>)ListB_Channels.ItemsSource; kek.Add(elc.NewChannel); Refresh(); } } }
private void B_Contex_Edit_Click(object sender, RoutedEventArgs e) { int id = ListB_Channels.SelectedIndex; if (id >= 0) { var tempCast = (List <string>)ListB_Channels.ItemsSource; var element = tempCast[id]; Dialogs.EditListOfChannelsAdd elc = new Dialogs.EditListOfChannelsAdd(element); var result = elc.ShowDialog(); if (result != null && result == true) { if (elc.NewChannel != "") { tempCast[id] = elc.NewChannel; Refresh(); } } } }