Пример #1
0
        private void KeyDownHandler(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Delete)
            {
                Point pt  = Mouse.GetPosition(this);
                var   hit = VisualTreeHelper.HitTest(this, pt);

                if (hit == null)
                {
                    return;
                }

                var hh = hit.VisualHit;

                while (hh != null && !(hh is ItemVisualizer))
                {
                    hh = VisualTreeHelper.GetParent(hh);
                }

                if (hh != null)
                {
                    Items.Remove(((ItemVisualizer)hh).Item);
                }

                NewlyAddedRanges.Clear();
                ResizeScrollbarThumb();
            }
        }
Пример #2
0
 internal void EndUpdate()
 {
     NewlyAddedRanges.Clear();
     _supressrebuild = false;
     _stashRange.Rebuild();
     ResizeScrollbarThumb();
 }
Пример #3
0
 internal void RemoveItem(Item item)
 {
     Items.Remove(item);
     NewlyAddedRanges.Clear();
     ResizeScrollbarThumb();
 }