From the course: Microsoft XAML: 2 Content and Properties

Unlock the full course today

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

Attached properties with the grid

Attached properties with the grid

From the course: Microsoft XAML: 2 Content and Properties

Start my 1-month free trial

Attached properties with the grid

- [Narrator] I thought I would look at setting some attached properties and reading some attached properties, and the example I'll work with is a grid, and its attached properties. So what I have in my UI is an ellipse. You can see it over here, and if I click on my grid, you can see in the designer, the rows and columns that are part of this grid. So you define those in a grid, by setting our RowDefinitions and ColumnDefinitions. I've created three columns and three rows, and I've set the height to a factor here. I have 1.0, 1.5, and 1.0. These are units, so that means that the middle row is slightly higher and slightly wider than the other rows and columns. I've defined my columns and my rows and I've put the ellipse in the first row in the first column, and I did that by just putting the ellipse in here. I didn't specify a row and I didn't specify a column, so it goes in row zero, column zero. So the user dependency property in XAML, you type the name of the class that defines the…

Contents