Is there a keyboard shortcut to switch between XAML and Designer in VS 2012?
Asked Answered
H

3

18

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.

Heine answered 21/11, 2012 at 18:31 Comment(0)
A
30

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

Asset answered 21/11, 2012 at 19:6 Comment(3)
Oh cool, +1 BoltClock, I didn't even know about the <kbd> tag!Asset
I used that comment in the code behind, and didn't realize it applied in the designer. Thanks!Heine
And, apparently, you can go the other way with F7Samarium
B
10

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

Blacktop answered 23/11, 2012 at 18:12 Comment(1)
VS2015 has moved to Options | XAML Designer | General.Calculable
M
3

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

Milk answered 27/6, 2017 at 15:54 Comment(1)
I would also recommend alt + w as a great keyboard binding for this, if you use alt + tab and ctrl + tab a lotMilk

© 2022 - 2024 — McMap. All rights reserved.