Esempio n. 1
0
 private static void DetachOldDataSourceCollectionChangedListener(SerialChart chart, object dataSource)
 {
     if (dataSource != null && dataSource is INotifyCollectionChanged)
     {
         (dataSource as INotifyCollectionChanged).CollectionChanged -= chart.OnDataSourceCollectionChanged;
     }
 }
Esempio n. 2
0
 private static void AttachDataSourceCollectionChangedListener(SerialChart chart, object dataSource)
 {
     if (dataSource != null && dataSource is INotifyCollectionChanged)
     {
         (dataSource as INotifyCollectionChanged).CollectionChanged += new NotifyCollectionChangedEventHandler(chart.OnDataSourceCollectionChanged);
     }
 }
Esempio n. 3
0
        private static void OnDataSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SerialChart chart = d as SerialChart;

            DetachOldDataSourceCollectionChangedListener(chart, e.OldValue);
            AttachDataSourceCollectionChangedListener(chart, e.NewValue);
            chart.ProcessData();
        }