Go To Definition in XAML Code Editor – Visual Studio 2013

Go To Definition in XAML Code Editor – Visual Studio 2013

XAML Editor in Visual Studio 2013 now support the Go To Definition (F12) feature. Behavior of this feature is similar to what we have used with C# or other code editors within Visual Studio.  You can now select “Go To Definition” for any of the objects, XAML controls, Control Properties or even custom controls from the XAML Editor.

Selecting Go To Definition for binding element resulting to take the navigation to the code behind property definition. As shown in the below images; while selecting “Go To Definition” for “Title” property, Visual Studio taking us to the property definition code block of Title property.

Go To Definition - Property

Go To Definition - Property Binding

This works in a different way with XAML Controls and Control Properties. If you select Go To Definition for a XAML Control; the navigation will take you to the Object Browser.

For an example, if you select “Grid” from the XAML editor,

Go To Definition in XAML

Visual Studio will take you to Object Browser by selecting the “Grid” element in the  browser window.

Go To Definition in XAML - Object Browser

Another interesting fact, if you select the control property such as “Grid.RowDefinition”, Visual Studio will take the navigation to the object browser and also highlight the RowDefinition property as shown in picture below.

Go To Definition in XAML - Object Browser Property Level

This is one of the sort, simple and most useful feature of Visual Studio. This feature saves a lot of time during debugging as well as development. Now you can enjoy this feature with XAML Editor as well.

Please share your feedback or comments if any.

Thanks.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.