How to reference a row/column definition in Grid.Row/Grid.Column?

前端 未结 2 1300
情深已故
情深已故 2020-12-28 22:27

This may be obvious... How do I reference XAML elements later in that same XAML file?

Example:


    

        
2条回答
  •  佛祖请我去吃肉
    2020-12-28 22:53

    This, unfortunately, doesn't work.

    The attached properties in question (ie: Grid.Row) are used by grid to handle their own layout, and the way it's designed, you have to put in the number.

    Unfortunately, changing the numbers when inserting a row is pretty common in XAML development. One option - You can put in extra "zero height" rows that are unused, and later use them, if you know you're going to be adding rows.

提交回复
热议问题