5

I'm currently writing an extension that provides a custom TextFormattingParagraphProperties (via ITextParagraphPropertiesFactoryService). This seems to work fine except for when I want to update the formatting of lines due to changes elsewhere in the document.

It seems that ITextParagraphPropertiesFactoryService.Create() is called only for each line that the editor has determined is "invalid" (either if the line changes or it becomes visible on screen).

Is there any way I can force the IWpfTextView to refresh it's layout (either of the entire visible document or, ideally, specific lines)?

P.S. The specific feature of TextFormattingParagraphProperties that I'm using is TextTabProperties and AFAIK, this is the only way to modify individual spacings of tabs (i.e. so they aren't all uniform)

Thanks

Grant Peters
  • 7,691
  • 3
  • 45
  • 57
  • Are you sure you need to define ITextParagraphPropertiesFactoryService instead of ISmartIndentProvider? ISmartIndentProvider sets the indention of the first tab, any reason you want to change order of other tabs? – Arsen Mkrtchyan Nov 07 '12 at 23:56
  • @ArsenMkrt Because I want to modify the actual tab lengths after text (trying to work on better whitespace layout for easier visibility). i.e. All tabs could have a different length depending on the features of the code. – Grant Peters Dec 13 '12 at 03:34
  • I did something similar, and found only one way of doing that, you should create fake classifier and fire clasifier changed event when you need to refresh, Unfortunately this doesn't work for vs2012. I try hard to find workaround for vs2012 but couldn't...I can send you samples by mail if you want... – Arsen Mkrtchyan Dec 13 '12 at 09:27

0 Answers0