silverlight: How to set attached properties Programmatically

后端 未结 3 1932
小鲜肉
小鲜肉 2021-02-05 05:58

Suppose I have a grid with some row definitions, and a child control in that grid. How would I go about setting the Grid.Row property of the child control programatically?

3条回答
  •  忘了有多久
    2021-02-05 06:36

    To set the value:

    textBlock.SetValue(Grid.RowProperty, 3);
    

    To reset the value:

    textBlock.SetValue(Grid.RowProperty, null);
    

提交回复
热议问题