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 desi
You can add this to the Tools
menu in Visual Studio.
Once configured, use Tools..XAML Designer Restart
:
Alt+T then L
I tried configuring it for Alt+T then X but this clashed with Tools..Choose ToolboX Items
.
These days, I prefer to just hit Ctrl+Shift+Esc to bring up the process manager, then X to skip to XDesProc.exe
then Delete to kill the rogue process(es).
There is any event handled in that XAML file, then mostly it will not display the design preview from Visual Studio. If you want to see the design from Visual Studio, try with Command Binding instead of event, you will see the preview.
When you add a new row of code or a new object, XAML designer is sync but I encountered non-sync behavior when a property of an object is changed.
A tricky way is that when you change a property you only need to remove a ">" character from end of an instruction then retype it.
I'm not sure, but I think a build will refresh your view in that situation.
In newer versions of Visual Studio there is an icon on the bottom of the designer to "Disable Project code". If you toggle this off and on it will reload the designer.
For information, I had the same issue with the XAML Designer of Visual Studio Community 2017, i.e. sometimes the designer doesn't show anything, the easiest solution is then to close the XAML file and reopen it.
I also frequently get the exception "An Unhandled Exception has occurred - Click here to reload the designer - Details: The XAML Designer has exited unexpectedly" (the click restarts the designer successfully).
Note that, in this VS version, the process of the XAML designer is not named XDesProc.exe, but UwpSurface.exe. If you prefer or have to kill the process, then the designer shows the same exception as above, and you may restart it.