From the course: Microsoft XAML: 2 Content and Properties

Unlock the full course today

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

Attached properties with the canvas

Attached properties with the canvas

From the course: Microsoft XAML: 2 Content and Properties

Start my 1-month free trial

Attached properties with the canvas

- [Instructor] In this demonstration, I'll show the attached property for the canvas class. The UI that I have is a canvas element on Line 12 that contains two ellipses. A canvas is used for absolute positioning of elements and, in my case, I've got this orange ellipse and I've got the lavender ellipse. And they're both in the upper left hand corner. The reason why the orange ellipse is in the upper left hand corner is because I put it there, canvas.left equals zero and canvas.top equals zero. The reason why the lavender ellipses is there is because that's the default position. I didn't provide a canvas.top property or a canvas.left, so it's in the same position. I'll change that by using canvas.left equal 200. And that moves it 200 pixels from the left side of the ellipse. They're pretty self explanatory. If I use the right property, canvas.right, it moves it 200 pixels from the right side of the canvas. And there's also top and bottom. It's pretty straightforward. Works the way all…

Contents