public EditorView(ITextMarkerService textMarkerService) { _textMarkerService = textMarkerService; InitializeComponent(); ErrorsRow.Height = new GridLength(0); var rowStyle = new Style(typeof(DataGridRow), (Style)FindResource("MetroDataGridRow")); rowStyle.Setters.Add(new EventSetter(MouseDoubleClickEvent, new MouseButtonEventHandler(OnErrorsGridMouseDoubleClick))); ErrorsGrid.RowStyle = rowStyle; _foldingManager = FoldingManager.Install(TextEditor.TextArea); _foldingStrategy = new XmlFoldingStrategy(); TextEditor.TextChanged += (sender, args) => { _foldingStrategy.UpdateFoldings(_foldingManager, TextEditor.Document); }; _textMarkerService.SetTextEditor(TextEditor); var textView = TextEditor.TextArea.TextView; textView.BackgroundRenderers.Add(_textMarkerService); textView.LineTransformers.Add(_textMarkerService); textView.Services.AddService(typeof(ITextMarkerService), _textMarkerService); textView.MouseHover += MouseHover; textView.MouseHoverStopped += TextEditorMouseHoverStopped; textView.VisualLinesChanged += VisualLinesChanged; }