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?
On Windows, check the Enable XAML Hot Reload checkbox (and the required platforms) at Tools > Options > Debugging > Hot Reload. In earlier versions of Visual Studio 2019, the checkbox is at Tools > Options > Xamarin > Hot Reload.
With XAML Hot Reload, you can incrementally build and test XAML code for your WPF and UWP apps. You can do so with the benefit of the running app's data context, authentication state, and other real-world complexity that's hard to simulate during design-time.
To open the XAML Designer, right-click a XAML file in Solution Explorer and choose View Designer. to switch which window appears on top: either the artboard or the XAML editor.
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.
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 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.
To do it fast:
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With