views:

673

answers:

5

I'm used to press shift+F7 to switch between my code behind and the designer (which takes between 1 and 5 seconds to load) then I always have to click on View Xaml to modify my XAML code.

I don't find any shortcut in Tools/Options/Keyboard to go directly (from code behind to XAML code). How can I do that ?

+4  A: 

In VS2008, while in code-behind of your XAML page (.xaml.cs), pressing SHIFT-F7 will take you to the XAML Designer or the XAML code page, depending on which one had the latest focus. Pressing SHIFT-F7 again will take you from the XAML code page to the designer and vice versa.

While in the XAML designer or XAML code page, pressing F7 takes you to the related code behind page.

DaveBost
SHIFT-F7 always take me to the XAML Designer :(
Nicolas Dorier
I find it will go to the Designer if that's what you last had open and the XAML markup if that's what you had open.
brendan
Very strange... it works like you said now >_<
Nicolas Dorier
A: 

For VS 2008:

F7 goes from XAML to Code Behind, Shift-F7 goes from Code Behind to XAML

Bryan Anderson
SHIFT-F7 goes to the XAML design, not in the XAML code page, that's my problem
Nicolas Dorier
Hmm, goes to the code page for me. But then I have the designer turned off.
Bryan Anderson
how did you do to turn of the designer ?
Nicolas Dorier
Tools->Options->Text Editor->XAML->Miscellaneous, check "Always open documents in full XAML view".
Bryan Anderson
It's already check, Shift+F7 in a UserControl will bring me to the XAML view but on a Window it brings me always to the Designer View :(
Nicolas Dorier
A: 

Download dpack for visual studio (free) - then F7 will always switch to the "other" view. Plenty of other great features in there too.

James Cadd
I already have DPack, it's a great add-in, I Love the file and classes indexing, nice feature instead of using the Solution Explorer, but F7 always go from the designer or xaml code to the code behind.
Nicolas Dorier
A: 

It is Ctrl-Shift-F7.

Download this the keyboard shortcut poster from MS for all the Keyboard short cuts.

Visual C# 2008 Keybinding Reference Poster

Visual Basic 2008 Keybinding Reference Poster

David Basarab
Ctrl-Shift-F7 is not used in my visual studio and I can't see it on the poster. But vote up for the poster ;)
Nicolas Dorier
A: 

When I first installed VS2010, my keyboard mappings were set to (Default). The default setting had View.ViewDesigner mapped to "Shift-F7 (HTML Editor Source View)". To get the shortcut to work in all views, I had to change the mapping to "Shift-F7 (Global)". Changing the keyboard mappings to "Visual C# 2005" worked as well.

ibowl