为UserControl设置Canvas.Top

时间:2012-01-01 23:21:49

标签: wpf dependency-properties geometry

我正在基于椭圆创建简单的圆控制(具有中心和半径属性)。

使用我的控件的代码很简单(控件在Canvas中):

<my:Circle Canvas.Left="1300" Canvas.Top="1243" CenterX="800" CenterY="800" Radius="100" />

我创建了3个DP:CenterX,CenterY和Radius。

如何从回调中更改Canvas.Top和Canvas.Bottom?

1 个答案:

答案 0 :(得分:9)

致电Canvas.SetLeft(someControl, someDouble)