private static void OnDataSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { LoopingSelector picker = (LoopingSelector)obj; if (e.OldValue != null) { ((ILoopingSelectorDataSource)e.OldValue).SelectionChanged -= picker.OnDataSourceSelectionChanged; } if (e.NewValue != null) { ((ILoopingSelectorDataSource)e.NewValue).SelectionChanged += picker.OnDataSourceSelectionChanged; } picker.UpdateData(); }
private static void OnDataModelChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { LoopingSelector picker = (LoopingSelector)obj; picker.UpdateData(); }