[英]How can I programmatically refresh Visual Studio Solution Explorer?
[英]How can I programmatically refresh Visual Studio WPF designers?
是否可以在 Visual Studio 中以編程方式刷新 WPF 設計師 windows,例如使用 DTE?
我有一些設計時行為,我想在檢測到文件系統更改后刷新 WPF 設計師 windows。
我努力了:
dte.ItemOperations.OpenFile(file) //where file is a xaml file
但這沒有效果。
更新
我正在尋找一個不關閉然后重新打開 xaml 文件的解決方案,因為這太笨拙了。 我正在尋找一種讓 WPF 設計人員重新加載\刷新的方法,就像他們在重建解決方案時所做的那樣。
我能想到的最好的是
dte.ActiveDocument.Close(vsSaveChanges.vsSaveChangesNo);
dte.ItemOperations.OpenFile(FileName);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.