Exemplo n.º 1
0
        /// <summary>
        /// Invalidates the CompositionAdorner render.
        /// Used in TextServicesDisplayAttributePropertyRanges (for composition display attribute)
        /// </summary>
        internal void InvalidateAdorner()
        {
            for (int i = 0; i < _attributeRanges.Count; i++)
            {
                // Get the composition attribute range from the attribute range lists
                AttributeRange attributeRange = (AttributeRange)_attributeRanges[i];

                // Add the composition lines for rendering the composition lines
                attributeRange.AddCompositionLines();
            }

            // Invalidate the CompositionAdorner to update the rendering.
            AdornerLayer adornerLayer = VisualTreeHelper.GetParent(this) as AdornerLayer;

            if (adornerLayer != null)
            {
                adornerLayer.Update(AdornedElement);
                adornerLayer.InvalidateArrange();
            }
        }