[英]Changes made in designer not visible
I have a really stupid problem that I just don't understand : I have a WPF application project, and no matter what I do, the changes I do in the designer are not visible when I run the application ! 我有一个我根本不理解的非常愚蠢的问题:我有一个WPF应用程序项目,无论我做什么,当我运行该应用程序时,我在设计器中所做的更改都不可见! I have been working on this project for weeks and all over sudden it's not working anymore.
我已经在这个项目上工作了几个星期,突然之间,它不再工作了。
However, when I change something in the code (MainWindow.xaml.cs for instance) it works. 但是,当我更改代码中的某些内容(例如MainWindow.xaml.cs)时,它可以工作。 I tried showing a messagebox and it showed up when i started the application.
我尝试显示一个消息框,并在启动该应用程序时显示它。
It's probably really silly, but I can't figure this out ! 这可能真的很傻,但是我无法弄清楚!
Any ideas what might be causing this ? 任何想法可能是什么原因造成的?
EDIT : 编辑:
If I add this code : 如果我添加此代码:
System.Windows.Forms.MessageBox.Show("test");
to the MainWindow constructor the MessageBox appears : 到MainWindow构造函数,出现MessageBox:
but if I try to just change the color of a button in designer : 但是如果我尝试仅更改设计器中按钮的颜色:
the button doesn't change at runtime : 该按钮在运行时不会更改:
Had encountered the same issue before. 之前遇到过同样的问题。 Just closed but save your solution and try re-openning it.
刚刚关闭,但保存您的解决方案,然后尝试重新打开它。 I also restarted my computer just to make sure everything is refreshed.
我还重新启动了计算机,以确保一切都刷新了。 :-) For some reason, it helped.
:-)由于某种原因,它有所帮助。
Moved from comments -- 从评论移至-
is your VS setup correct ? 您的VS设置正确吗? do you build all your files every time ?
每次都生成所有文件吗?
try clean and re - build, 尝试清洁并重建,
looks like either your project isn't building or VS is not detecting the file changed 看起来您的项目未构建或VS未检测到文件更改
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.