Use the Margin property to add an empty buffer around the edge of an element. Margin uses a Thickness value instead of a simple integer value. See how this allows different values for the Left, Top, Right, and Bottom margins.
- [Instructor] In this video…I'll look at the margin property.…This is a way for an element to specify…a buffer around the edges of the element.…This means when you set the margin…and the layout engine goes to arrange…around the screen, if there's a margin present,…the element will be positioned that distance…away from it's nearest neighbor,…also according to the layout rules…of whatever panel that it's in.…For this example I'm in a stack panel…that has several letter boxes.…All of these letter boxes are using…the default margin which is a value…of zero for all four sides.…
Here you can see on line 14 I've specified…an explicit margin value,…the rest of them are using an implicit value.…Now, I'll switch over here and set the margin from B.…This is a numeric value or a common delimited value.…I'll start by using the simplest…which is to set all four sides.…I'll type in a number here of 10.…What you see over in the Designer…is that the stack panel…pushed the letter box B down…10 pixels away from letter box A.…
It moved the left and right edges in 10 pixels…
- Exploring the layout panels
- Working with the grid
- Adding rows and columns
- Creating scrolling content
- Controlling element visibility
- Aligning content
- Making custom layout panels
Skill Level Intermediate
Learning Visual Studio Team Serviceswith Jose Miguel Rady Allende1h 17m Intermediate
1. Layout Panels
2. Other Layout Concepts
3. Custom Layout Panel
Next steps1m 34s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.