如何为WPF手动重新加载Visual Studio设计器 [英] How to manually reload the Visual Studio designer for WPF

查看:283
本文介绍了如何为WPF手动重新加载Visual Studio设计器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以强制WPF设计器重新加载或刷新,而无需重新构建整个项目或解决方案?

Is there any way to force the WPF designer to reload or refresh, without rebuilding the entire project or solution?

如果出现错误,我可以在设计器视图中获得一个选项来刷新设计器.但是,如果没有错误,进行更改后如何让设计者刷新?

If there's an error, I get an option in the designer view to refresh the designer. But if I don't have an error, how can I get the designer to refresh after I've made a change?

推荐答案

我来晚了一点,但这是最好的解决方法 1 到目前为止,我发现:每当设计师做一些愚蠢的事情时,我只是杀死了它的过程.

I'm a little late but this is the best solution1 I've found so far: whenever the designer does stupid stuff, I just kill it's process.

Ctrl + Shift + Esc
导航到进程"选项卡.
杀死 XDesProc.exe

Press Ctrl+Shift+Esc
Navigate to the Processes tab.
Kill XDesProc.exe

这也解决了属性窗口的问题(例如,当它被卡住并且您无法在其中键入内容时).

This also fixes issues for the properties window (like when it gets jammed and you can't type stuff into it).

1 这是针对设计师问题的解决方案.您的问题也可能是由编译问题引起的,在这种情况下,只需在解决方案资源管理器中右键单击该解决方案,然后进行清理即可.其背后的原因是,有时编译会失去与XAML生成的文件的同步性,而清理解决方案只会删除那些中间文件;就像重置一样,因此您的编译可以从一开始就完成.

1 This is a solution for designer issues. Your issues may also be caused by compilation problems, in which case just right click on the solution in the solution explorer, and clean it. The reason behind it is that sometimes the compilation loses synchronicity with the generated files from XAML, and cleaning the solution just deletes those intermediate files; it's like a reset so your compilation can start off with a clean slate.

要快速做到这一点:

如果按字母顺序排序,通常它是最后一个.
在这种情况下,快速弹出任务管理器,单击任何进程,按 End Delete Enter 几乎就像是一种仪式. (完成), Esc (退出任务管理器).而不是重新启动VS并等待所有负载&卸载后,您可以在1-2秒内完成操作.

Comfortably it's usually the last one if sorted alphabetically.
When it is, it's almost like a ritual for me to quickly pop up the task manager, click any process, press End, Delete, Enter (done), Esc (exit task manager). Instead of restarting VS and waiting for all the loads & unloads, you can do that in 1-2 seconds.

这篇关于如何为WPF手动重新加载Visual Studio设计器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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