private void ShowConnectionDialog(UnicornConnection info = null) { var shouldUpdate = SelectedConnection != null; info = info ?? new UnicornConnection(); var newConnection = new NewConnection(info); if (newConnection.ShowModal() != true) { return; } LoadConnections(); if (shouldUpdate) { SelectedConnection = null; SelectedConnection = info; } }