private static void OnHighlightedLinesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var editor = d as TextEditor;
            if (editor == null)
                return;

            var highlighter = editor.TextArea.TextView.BackgroundRenderers.OfType<LineHighlighterBackgroundRenderer>().SingleOrDefault();
            if (highlighter == null)
            {
                highlighter = new LineHighlighterBackgroundRenderer();
                editor.TextArea.TextView.BackgroundRenderers.Add(highlighter);
            }

            highlighter.HighlightedLines = e.NewValue as int[];
        }
        private static void OnHighlightedLinesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var editor = d as TextEditor;

            if (editor == null)
            {
                return;
            }

            var highlighter = editor.TextArea.TextView.BackgroundRenderers.OfType <LineHighlighterBackgroundRenderer>().SingleOrDefault();

            if (highlighter == null)
            {
                highlighter = new LineHighlighterBackgroundRenderer();
                editor.TextArea.TextView.BackgroundRenderers.Add(highlighter);
            }

            highlighter.HighlightedLines = e.NewValue as int[];
        }