How to manually reload the Visual Studio designer for WPF

前端 未结 9 1716
广开言路
广开言路 2020-12-23 13:17

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

相关标签:
9条回答
  • 2020-12-23 13:46

    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.

    Update

    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).

    0 讨论(0)
  • 2020-12-23 13:48

    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.

    0 讨论(0)
  • 2020-12-23 13:48

    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.

    0 讨论(0)
  • 2020-12-23 13:49

    I'm not sure, but I think a build will refresh your view in that situation.

    0 讨论(0)
  • 2020-12-23 13:53

    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.

    0 讨论(0)
  • 2020-12-23 13:53

    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.

    0 讨论(0)
提交回复
热议问题