Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the shorcut in visual studio to switch from code behind to Xaml Code?

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 ?

like image 702
Nicolas Dorier Avatar asked May 12 '09 12:05

Nicolas Dorier


People also ask

How do I get XAML in Visual Studio 2019?

To open this page, choose the Tools menu and then choose Options. To access the XAML Designer property page, choose the XAML Designer node. Settings for the XAML Designer are applied when you open the document. So, if you make changes to the settings, you need to close and then reopen Visual Studio to see the changes.

What can you do with XAML?

XAML is the language to build user interfaces for Windows and Mobile applications that use Windows Presentation Foundation (WPF), UWP, and Xamarin Forms. The purpose of XAML is simple, to create user interfaces using a markup language that looks like XML.


2 Answers

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.

UPDATE. Applicable for later versions (e.g. MS VS 2015 too).

like image 119
2 revs, 2 users 57% Avatar answered Sep 19 '22 14:09

2 revs, 2 users 57%


I've finally found the solution for VS 2010:

F7: switch between Code Behind and XAML (Design or Markup depending on last used)
Shift+F7: switch between XAML (Design) and XAML (Markup).

F7 shortcut mapping should look like "View.ToggleDesigner (F7 (Global))"
Shift+F7 shortcut mapping should look like "View.ViewDesigner (Shift+F7 (Global))" and "View.ViewMarkup (Shift+F7 (HTML Source Editor View))" (two mappings for one shortcut).

like image 38
nick4eva Avatar answered Sep 17 '22 14:09

nick4eva