src/GenFx.Wpf/Controls/MetricsChart.xaml.cs
/// <summary>
/// Handles the event when the <see cref="Algorithm"/> property changes.
/// </summary>
/// <param name="obj">The <see cref="DependencyObject"/> that owns the property.</param>
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> associated with the event.</param>
Handles the event when the  property changes.
Handles the event when the property changes .
private static void OnAlgorithmChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            MetricsChart control = (MetricsChart)obj;
            if (e.OldValue != null)
            {
                GeneticAlgorithm algorithm = (GeneticAlgorithm)e.OldValue;
                algorithm.FitnessEvaluated -= control.Algorithm_FitnessEvaluated;
            }
            if (e.NewValue != null)
            {
                GeneticAlgorithm algorithm = (GeneticAlgorithm)e.NewValue;
                algorithm.FitnessEvaluated += control.Algorithm_FitnessEvaluated;
            }
            control.RefreshAllSeries();
        }
private static void OnAlgorithmChanged ( DependencyObject obj , DependencyPropertyChangedEventArgs e ) { MetricsChart control = ( MetricsChart ) obj ; if ( e . OldValue != null ) { GeneticAlgorithm algorithm = ( GeneticAlgorithm ) e . OldValue ; algorithm . FitnessEvaluated -= control . Algorithm_FitnessEvaluated ; } if ( e . NewValue != null ) { GeneticAlgorithm algorithm = ( GeneticAlgorithm ) e . NewValue ; algorithm . FitnessEvaluated += control . Algorithm_FitnessEvaluated ; } control . RefreshAllSeries ( ) ; }
Handles the event when the  property changes.
Handles the event when the property changes .
obj
DependencyObject
The  that owns the property.
The that owns the property .
e
DependencyPropertyChangedEventArgs
The  associated with the event.
The associated with the event .