Yasir
Yasir

Reputation: 47

WPF: How to know Open Window, User control name

In the web application, we just right click on the page go to properties and can see the opened page path. How to achieve this in WPF application. I am running a WPF app having windows with many user control. I want to edit a user control. So I want to know its name and location in my project folder.

Upvotes: 0

Views: 531

Answers (1)

That is not possible like how you can in a web application, however there are some tools that can help you.

WPF Snoop

Used to inspect WPF application rather like 'Inspect Element' in a webpage. After inspection, pressing ALT+SHIFT will higlight what element is under the mouse and show you its name. Then you can search for that name in Visual Studio to find the class to edit.

See https://github.com/snoopwpf/snoopwpf

enter image description here

Visual Studio XAML Inspector

The microsoft version of the above 'Live Visual Tree Inspector' now built into Visual Studio and compatible with .NET Core 3.0 as well as .NET Framework.

See https://learn.microsoft.com/en-gb/visualstudio/xaml-tools/inspect-xaml-properties-while-debugging?view=vs-2019

enter image description here

Upvotes: 1

Related Questions