Change Canvas.Left property in code behind?

后端 未结 3 2054
梦如初夏
梦如初夏 2020-12-08 00:13

I have a rectangle in my XAML and want to change its Canvas.Left property in code behind:



        
3条回答
  •  半阙折子戏
    2020-12-08 00:26

    As we are changing the property of the 'object', it would be better to use method suggedte by JaredPar:

    theObject.SetValue(Canvas.LeftProperty, 50d);
    

提交回复
热议问题