private void Edit_Connection(object sender, RoutedEventArgs e) { // Clicked connection var connection = (Connection)((Button)sender).DataContext; // Let user edit it var save = new EditConnectionWindow(connection).ShowDialog(); if (save != true) { // TODO edit Cancel => Revert changes } // Update view DisplayConnectionInListView(); }
private void Add_Connection(object sender, RoutedEventArgs e) { // Create default connection var connection = new Connection(); // Let user edit it var save = new EditConnectionWindow(connection).ShowDialog(); if (save == true) { SettingsManager.Instance.CurrentSettings.Connections.Add(connection); } // Update view DisplayConnectionInListView(); }