如何强制IWpfTextView刷新/使它的布局无效? [英] How can I force an IWpfTextView to refresh/invalidate it's layout?

查看:114
本文介绍了如何强制IWpfTextView刷新/使它的布局无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

In my extension(MEF) I want to set tab offsets for every line programitically.

我不仅需要在该行中设置第一个制表符偏移量,还需要设置其他制表符偏移量,因此我创建了TextFormattingParagraphProperties属性,并在创建方法中计算了制表符偏移量并返回了适当的值.这个工作到我 要刷新其他行的制表符偏移,希望第一行发生变化.似乎VS仅针对已编辑的行调用ITextParagraphPropertiesFactoryService.Create方法.

I need to set not only the first tab offset but also the other tab offsets too in the line, so I created TextFormattingParagraphProperties  and do calculation of tab offsets in create methods and return appropriate values. This works untill I want to refresh tab offsets of other lines, expect the line one is changing. Seems VS call ITextParagraphPropertiesFactoryService.Create method only for the edited line.

有没有办法强制其他行刷新? 

Is there any way to force the other lines refresh too? 

我发现的一种方法是每次更改选项卡时都创建一个分类器并触发事件,但这仅适用于VS2010.是否有任何理由为什么提神的分类器不会调用 ITextParagraphPropertiesFactoryService.Create  在VS2012上并在VS2010上调用?

One way I found is to create a classifier and fire event each time tabs changed, but this works only for VS2010. Are there any reason why refreshing classifer doesn't call ITextParagraphPropertiesFactoryService.Create  on VS2012 and call on VS2010? 

预先感谢

Arsen

推荐答案

嗨Arsen,

Hi Arsen,

感谢您在MSDN论坛中发帖.
 
我将请一些专家来解决这个问题,看看他们是否可以为您提供帮助.可能会有一些时间延迟,感谢您的耐心配合.
 
感谢您的理解和支持.
 
最好的问候,

Thank you for posting in the MSDN Forum.
 
I will involve some experts into this issue to see whether they can help you out. There might be some time delay, appreciate for your patience.
 
Thank you for your understanding and support.
 
Best regards,


这篇关于如何强制IWpfTextView刷新/使它的布局无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆