/// <summary>
 /// New instance
 /// </summary>
 /// <param name="handler">Handler for this highlight adorner.</param>
 /// <param name="bodyHighlight">The corresponding highlight adorner in the body of the text.</param>
 public ScrollBarHighlightAdorner(ScrollBarHighlightHandler handler, HighlightAdorner bodyHighlight)
     : base(handler.ScrollViewer)
 {
     this.bodyHighlight = bodyHighlight;
     this.handler       = handler;
     IsHitTestVisible   = false;
 }
        /// <summary>
        /// New instance
        /// </summary>
        /// <param name="handler">Handler for this highlight adorner.</param>
        /// <param name="bodyHighlight">The corresponding highlight adorner in the body of the text.</param>
        public ScrollBarHighlightAdorner(ScrollBarHighlightHandler handler, HighlightAdorner bodyHighlight)
            : base(handler.ScrollViewer)
        {
            this.bodyHighlight = bodyHighlight;
            this.handler = handler;
            IsHitTestVisible = false;

        }
 private static void UpdateHighlighting(UIElement uiHost, ScrollBarHighlightHandler scrollBarHighlightHandler)
 {
     AdornerLayer lay = AdornerLayer.GetAdornerLayer(uiHost);
     if (lay != null)
     {
         lay.Update();
     }
     scrollBarHighlightHandler.Update();
 }
Exemple #4
0
        private static void UpdateHighlighting(UIElement uiHost, ScrollBarHighlightHandler scrollBarHighlightHandler)
        {
            AdornerLayer lay = AdornerLayer.GetAdornerLayer(uiHost);

            if (lay != null)
            {
                lay.Update();
            }
            scrollBarHighlightHandler.Update();
        }
 /// <summary>
 /// New instance.
 /// </summary>
 /// <param name="elementToHighlight">The element being highlighted.</param>
 /// <param name="bodyHighlightAdornerBrush">Brush to paint highlight with</param>
 /// <param name="bodyHighlightAdornerPen">Pen to paint highlight border with, specifying a pen can slow down painting when highlights span multiple lines.</param>
 /// <param name="bodyIterativeHighlightAdornerBrush">Brush to paint iterative highlight with</param>
 /// <param name="bodyIterativeHighlightAdornerPen">Pen to draw iterative highlight border with</param>
 public HighlightHandler(DependencyObject elementToHighlight, Brush bodyHighlightAdornerBrush, Pen bodyHighlightAdornerPen, Brush bodyIterativeHighlightAdornerBrush, Pen bodyIterativeHighlightAdornerPen)
 {
     this.BodyHighlightAdornerBrush          = bodyHighlightAdornerBrush;
     this.BodyHighlightAdornerPen            = bodyHighlightAdornerPen;
     this.BodyIterativeHighlightAdornerBrush = bodyIterativeHighlightAdornerBrush;
     this.BodyIterativeHighlightAdornerPen   = bodyIterativeHighlightAdornerPen;
     this.elementToHighlight   = elementToHighlight;
     this.uiElementToHighlight = elementToHighlight as UIElement;
     if (this.uiElementToHighlight != null)
     {
         this.uiElementToHighlight.GotFocus      += elementToHighlight_GotFocus;
         this.uiElementToHighlight.LayoutUpdated += elementToHighlight_LayoutUpdated;
         scrollBarHighlightHandler = new ScrollBarHighlightHandler(this.uiElementToHighlight);
     }
     //ProbeScrollElements(elementToHighlight);
 }
 /// <summary>
 /// New instance.
 /// </summary>
 /// <param name="elementToHighlight">The element being highlighted.</param>
 /// <param name="bodyHighlightAdornerBrush">Brush to paint highlight with</param>
 /// <param name="bodyHighlightAdornerPen">Pen to paint highlight border with, specifying a pen can slow down painting when highlights span multiple lines.</param>
 /// <param name="bodyIterativeHighlightAdornerBrush">Brush to paint iterative highlight with</param>
 /// <param name="bodyIterativeHighlightAdornerPen">Pen to draw iterative highlight border with</param>
 public HighlightHandler(DependencyObject elementToHighlight, Brush bodyHighlightAdornerBrush, Pen bodyHighlightAdornerPen, Brush bodyIterativeHighlightAdornerBrush, Pen bodyIterativeHighlightAdornerPen)
 {
     this.BodyHighlightAdornerBrush = bodyHighlightAdornerBrush;
     this.BodyHighlightAdornerPen = bodyHighlightAdornerPen;
     this.BodyIterativeHighlightAdornerBrush = bodyIterativeHighlightAdornerBrush;
     this.BodyIterativeHighlightAdornerPen = bodyIterativeHighlightAdornerPen;
     this.elementToHighlight = elementToHighlight;
     this.uiElementToHighlight = elementToHighlight as UIElement;
     if (this.uiElementToHighlight != null)
     {
         this.uiElementToHighlight.GotFocus += elementToHighlight_GotFocus;
         this.uiElementToHighlight.LayoutUpdated += elementToHighlight_LayoutUpdated;
         scrollBarHighlightHandler = new ScrollBarHighlightHandler(this.uiElementToHighlight);
     }
     //ProbeScrollElements(elementToHighlight);
 }