From the course: Windows Presentation Foundation 5: Interaction and Controls

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Use the Shape Stretch property

Use the Shape Stretch property

From the course: Windows Presentation Foundation 5: Interaction and Controls

Start my 1-month free trial

Use the Shape Stretch property

- [Instructor] The shape class has a property called stretch which we'll examine in this video. First stop is to look at the UI that I created for this demo. I have a grid and in this top row of the grid are four ellipses and in the bottom row are four more ellipses. Let's start by looking at this first ellipse, which has some properties that are shared by all the ellipses. So let's look at this in the zanal. This ellipse has no width and no height properties, so that means it defaults to auto. And it has the horizontal and the vertical alignment properties are not set either, which means they default to stretch. So what does that mean? I haven't specified any width at all, but I have given the container permission to stretch it as necessary by changing the alignment properties. So, normally, it would stretch it to fill the container which in the case is a grid cell. Now we'll look at the stretch property, which is a property on the shape class itself. So just to be clear, horizontal…

Contents