コード例 #1
0
        private static void SelectedIndexChangedCallback(DependencyObject owner, DependencyPropertyChangedEventArgs args)
        {
            ColorsListbox clb   = owner as ColorsListbox;
            int           index = (int)args.NewValue;

            clb.SelectedIndex = index;
        }
コード例 #2
0
        private static void SelectedItemChangedCallback(DependencyObject owner, DependencyPropertyChangedEventArgs args)
        {
            ColorsListbox clb  = owner as ColorsListbox;
            ColorItem     item = args.NewValue as ColorItem;

            clb.SelectedItem = item;
        }