private static void OnLabelsChanged(object sender, DependencyPropertyChangedEventArgs e) { MultiPointsGraph graph = sender as MultiPointsGraph; if (e.OldValue is ObservableRangeCollection <string> old_ && old_ != null) { old_.CollectionChanged -= graph.SetupXaxis; } if (e.NewValue is ObservableRangeCollection <string> new_ && new_ != null) { new_.CollectionChanged += graph.SetupXaxis; } }
private static void OnValuesChanged(object sender, DependencyPropertyChangedEventArgs e) { MultiPointsGraph graph = sender as MultiPointsGraph; if (e.OldValue is ObservableRangeCollection <KeyValuePair <int[], SolidColorBrush> > old_ && old_ != null) { old_.CollectionChanged -= graph.UpdateGraph; } if (e.NewValue is ObservableRangeCollection <KeyValuePair <int[], SolidColorBrush> > new_ && new_ != null) { new_.CollectionChanged += graph.UpdateGraph; } }