简体   繁体   中英

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 ! 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. 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 :

在此处输入图片说明

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 ? 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM