private static void SelectedIndexChangedCallback(DependencyObject owner, DependencyPropertyChangedEventArgs args) { ColorsListbox clb = owner as ColorsListbox; int index = (int)args.NewValue; clb.SelectedIndex = index; }
private static void SelectedItemChangedCallback(DependencyObject owner, DependencyPropertyChangedEventArgs args) { ColorsListbox clb = owner as ColorsListbox; ColorItem item = args.NewValue as ColorItem; clb.SelectedItem = item; }