Example #1
0
        private void RemoveInsertionAdorner()
        {
            if (_insertionAdorner == null)
            {
                return;
            }

            _insertionAdorner.Detach();
            _insertionAdorner = null;
        }
Example #2
0
        private void CreateInsertionAdorner()
        {
            if (_targetItemContainer == null)
            {
                return;
            }

            // Here, I need to get adorner layer from targetItemContainer and not targetItemsControl.
            // This way I get the AdornerLayer within ScrollContentPresenter, and not the one under AdornerDecorator (Snoop is awesome).
            // If I used targetItemsControl, the adorner would hang out of ItemsControl when there's a horizontal scroll bar.
            var adornerLayer = AdornerLayer.GetAdornerLayer(_targetItemContainer);

            _insertionAdorner = new InsertionAdorner(_hasVerticalOrientation, _isInFirstHalf, _targetItemContainer, adornerLayer);
        }