private void DeleteButtonClicked(object sender, RoutedEventArgs e) { var index = directoriesListBox.SelectedIndex; if (index != -1) { _directories.RemoveAt(index); AppManagement.SaveSettings(); RefreshListBox(); } }
private void AddButtonClicked(object sender, RoutedEventArgs e) { SynchronizedDirectory dir = new SynchronizedDirectory(); dir.name = nameTextBox.Text; dir.path = locationTextBox.Text; _directories.Add(dir); AppManagement.SaveSettings(); AddToListBox(dir.name); }