Question

When switching from a code file to a XAML file in Visual Studio 2012, the focus goes to the designer. If I want to edit the XAML (which is 99% of the time), I need to use the mouse to move the focus to the XAML code/markup window. Is there a way to move focus to the XAML without the mouse?

NOTE: There are similar questions in SO, but they deal with moving between code behind and XAML designer.

Was it helpful?

Solution

Yupp there sure is, just use Shift+F7 ;)

OTHER TIPS

For 99% of the times, you may want to set it to default

I don't know about other version, but in Visual Studio 2010, from the menu bar select ToolsOptions..., from the dialog, select Text EditorXAMLMiscellaneous, tick the Always open documents in full XAML view. Now everytime an XAML file is double clicked, it'll open in XAML (code) view, not design view.

Visual Studio 2010 XAML Settings

I hope the image is not too big

If Shift + F7 doesn't work right away then you may need to re-assign the context for which the keyboard shortcut applies. When I tried this in VS 2017 I had to go in and re-assign the shortcut by using the following steps:

  • Tools > Options
  • In the popup menu select Environment > Keyboard in the side bar
  • Type View.ViewDesigner in the search bar
  • Open the menu under Use new shortcut in:
  • Select Text Editor from the menu, enter desired shortcut into the assignment bar, and click assign
  • Select XAML Designer from the menu, enter desired shortcut into the assignment bar, and click assign
  • Click OK to apply the changes and exit the options menu

NOTE: You must do both Text Editor and XAML Designer in order to get this to work well. The image below shows the result of the above steps.

Keyboard Menu Image

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top