Ejemplo n.º 1
0
        private static void OnIsRectSelectionEnabledChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            if (!(sender is ListBox))
            {
                throw new ArgumentException("sender", "Target should be a ListBox and its sub class instance.");;
            }

            bool isEnabled = (bool)e.NewValue;

            if (isEnabled)
            {
                ListBoxRectSelection rectSelection = ListBoxExtention.GetRectSelection(sender);
                if (rectSelection == null)
                {
                    rectSelection = new ListBoxRectSelection(sender as ListView);
                    ListBoxExtention.SetRectSelection(sender, rectSelection);
                }
                rectSelection.IsEnabled = isEnabled;
            }
        }
Ejemplo n.º 2
0
 private static void SetRectSelection(DependencyObject obj, ListBoxRectSelection value)
 {
     obj.SetValue(RectSelectionProperty, value);
 }