Changeset 13837 for branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs
- Timestamp:
- 05/09/16 12:28:09 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs
r13836 r13837 32 32 namespace HeuristicLab.Algorithms.DataAnalysis.Views { 33 33 [View("Gradient View")] 34 [Content(typeof(I ConfidenceBoundRegressionSolution))]34 [Content(typeof(IRegressionSolution))] 35 35 public partial class RegressionSolutionGradientView : DataAnalysisSolutionEvaluationView { 36 36 private const int DrawingSteps = 1000; … … 44 44 } 45 45 46 public new I ConfidenceBoundRegressionSolution Content {47 get { return (I ConfidenceBoundRegressionSolution)base.Content; }46 public new IRegressionSolution Content { 47 get { return (IRegressionSolution)base.Content; } 48 48 set { base.Content = value; } 49 49 } … … 55 55 trackbars = new ObservableList<DensityTrackbar>(); 56 56 trackbars.ItemsAdded += (sender, args) => { 57 ForEach(args.Items.Select(i => i.Value),RegisterEvents);57 args.Items.Select(i => i.Value).ForEach(RegisterEvents); 58 58 }; 59 59 trackbars.ItemsRemoved += (sender, args) => { 60 ForEach(args.Items.Select(i => i.Value),DeregisterEvents);60 args.Items.Select(i => i.Value).ForEach(DeregisterEvents); 61 61 }; 62 62 trackbars.CollectionReset += (sender, args) => { 63 ForEach(args.OldItems.Select(i => i.Value),DeregisterEvents);64 ForEach(args.Items.Select(i => i.Value),RegisterEvents);63 args.OldItems.Select(i => i.Value).ForEach(DeregisterEvents); 64 args.Items.Select(i => i.Value).ForEach(RegisterEvents); 65 65 }; 66 66 … … 87 87 sharedFixedVariables = new ModifiableDataset(variableNames, newTrackbars.Select(tb => new List<double>(1) { (double)tb.Value })); 88 88 gradientChart.Configure(new[] { Content }, sharedFixedVariables, variableNames.First(), DrawingSteps); 89 gradientChart.UpdateChart ();89 gradientChart.UpdateChartAsync(); 90 90 91 91 // Add to table and observable lists … … 149 149 } 150 150 151 private void trackbar_ValueChanged(object sender, EventArgs e) {151 private async void trackbar_ValueChanged(object sender, EventArgs e) { 152 152 var trackBar = sender as DensityTrackbar; 153 153 if (trackBar == null) return; 154 154 sharedFixedVariables.SetVariableValue((double)trackBar.Value, variableNames[trackbars.IndexOf(trackBar)], 0); 155 gradientChart.UpdateChart();155 await gradientChart.UpdateChartAsync(); 156 156 } 157 157 … … 183 183 #endregion 184 184 185 public static void ForEach<T>(IEnumerable<T> source, Action<T> action) { 185 186 } 187 188 internal static class Extensions { 189 public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) { 186 190 foreach (T item in source) 187 191 action(item);
Note: See TracChangeset
for help on using the changeset viewer.