如何刷新Visual Studio扩展中的“属性”窗口?

时间:2013-03-15 17:37:31

标签: visual-studio inotifypropertychanged visual-studio-extensions system.componentmodel

我正在编写一个Visual Studio扩展,允许在“属性”窗口中编辑对象的属性。我使用ITrackSelection接口选择我想要编辑的对象,一切正常,属性显示在窗口中,我可以编辑它们。

但是,当外部更改属性时,我无法使Visual Studio刷新属性窗口。我尝试实现INotifyPropertyChanged,但PropertyChanged事件从未订阅。我还尝试实现ICustomTypeDescriptor并返回自定义PropertyDescriptor对象,并为AddValueChanged和SupportsChangeEvents提供覆盖,但是从不调用它们。

我缺少什么?如何告诉Visual Studio我的对象的属性已更改,并且必须更新属性窗口?

1 个答案:

答案 0 :(得分:0)

IVsUIShell.RefreshPropertyBrowser应该操作并更新属性窗口。

相关问题