Index: branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs
===================================================================
--- branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 12800)
+++ branches/crossvalidation-2434/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 12821)
@@ -62,11 +62,12 @@
         storeAlgorithmInEachRunCheckBox.Checked = true;
       } else {
+        disableUpdateToContent = true; // don't propagate changes from GUI elements back to the content
         Locked = ReadOnly = Content.ExecutionState == ExecutionState.Started;
         workersNumericUpDown.Value = Content.NumberOfWorkers.Value;
-        foldsNumericUpDown.Value = Content.Folds;
         samplesStartStringConvertibleValueView.Content = Content.SamplesStart;
         samplesEndStringConvertibleValueView.Content = Content.SamplesEnd;
         UpdateAlgorithmView();
         UpdateProblemView();
+        UpdateFolds();
         runCollectionView.Content = Content.Runs;
         algorithmParameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters;
@@ -74,4 +75,5 @@
         executionTimeTextBox.Text = Content.ExecutionTime.ToString();
         storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun;
+        disableUpdateToContent = false;
       }
     }
@@ -147,8 +149,10 @@
     #region Content Events
     private void Content_AlgorithmChanged(object sender, EventArgs e) {
+      disableUpdateToContent = true;
       UpdateAlgorithmView();
       UpdateFolds();
       UpdateProblemView();
       SetEnabledStateOfControls();
+      disableUpdateToContent = false;
     }
     private void UpdateAlgorithmView() {
@@ -162,11 +166,15 @@
     private void Content_ProblemChanged(object sender, EventArgs e) {
       if (Content.Problem != null) Content.Problem.Reset += Content_ProblemReset;
+      disableUpdateToContent = true;
       UpdateFolds();
       UpdateProblemView();
       SetEnabledStateOfControls();
+      disableUpdateToContent = false;
     }
 
     private void Content_ProblemReset(object sender, EventArgs e) {
+      disableUpdateToContent = true;
       UpdateFolds();
+      disableUpdateToContent = false;
     }
 
@@ -180,5 +188,7 @@
 
     private void Content_FoldsChanged(object sender, EventArgs e) {
+      disableUpdateToContent = true;
       UpdateFolds();
+      disableUpdateToContent = false;
     }
 
@@ -193,11 +203,13 @@
         partitionVariableComboBox.Items.Clear();
         partitionVariableComboBox.Items.Add(CrossValidation.NoPartitionVariable);
-        var ds = Content.Problem.ProblemData.Dataset;
-        var rows = Enumerable.Range(Content.SamplesStart.Value, Content.SamplesEnd.Value - Content.SamplesStart.Value);
-        foreach (var variable in Content.Problem.ProblemData.Dataset.DoubleVariables) {
-          if (Content.Problem.ProblemData.AllowedInputVariables.Contains(variable)) continue;
-          int distinctValues = ds.GetDoubleValues(variable, rows).Distinct().Count();
-          if (distinctValues < 2 || distinctValues > 20) continue;
-          partitionVariableComboBox.Items.Add(variable);
+        if (Content.Problem != null) {
+          var ds = Content.Problem.ProblemData.Dataset;
+          var rows = Enumerable.Range(Content.SamplesStart.Value, Content.SamplesEnd.Value - Content.SamplesStart.Value);
+          foreach (var variable in Content.Problem.ProblemData.Dataset.DoubleVariables) {
+            if (Content.Problem.ProblemData.AllowedInputVariables.Contains(variable)) continue;
+            int distinctValues = ds.GetDoubleValues(variable, rows).Distinct().Count();
+            if (distinctValues < 2 || distinctValues > 20) continue;
+            partitionVariableComboBox.Items.Add(variable);
+          }
         }
         partitionVariableComboBox.SelectedItem = Content.PartitionVariable;
@@ -256,5 +268,5 @@
     }
     private void workersNumericUpDown_ValueChanged(object sender, EventArgs e) {
-      if (Content != null)
+      if (Content != null && !disableUpdateToContent)
         Content.NumberOfWorkers.Value = (int)workersNumericUpDown.Value;
     }
