DaveDev
DaveDev

Reputation: 42185

Is it possible to have an outline and padding/margins of all containers in WPF?

This is something that would be very useful during development. For example, my android phone allows "Show Layout Boundaries" as a Developer Option, e.g.

enter image description here

With this, I can see outlines of all layouts, including the padding and margins. Is there something like this in WPF that I could use to see how each element on the screen relates to the other elements?

Upvotes: 0

Views: 201

Answers (2)

John C
John C

Reputation: 1981

While the program is running, you might be interested in Snoop, which lets you inspect and highlight arbitrary elements of the interface and explode the window into a 3D view. It's not the same visual as you're looking for, but similarly useful.

Upvotes: 1

Anatoliy Nikolaev
Anatoliy Nikolaev

Reputation: 22702

In WPF the only thing that seems to be close it is ShowGridLines property in Grid:

Enabling Grid lines creates dotted lines around all the elements within a Grid. Only dotted lines are available because this property is intended as a design tool to debug layout problems and is not intended for use in production quality code. If you want lines inside a Grid, style the elements within the Grid to have borders.

Example:

<Grid ShowGridLines="True" ... />

enter image description here

For more information, see this link:

ShowGridLines Property Allows You to See Individual Cells in Grid

Upvotes: 1

Related Questions