I have 开发者_高级运维a Canvas in Silverlight with two ellipses on it. The ellipses are animated via events in the code behind. I have added a line two the canvas and I would like each end of the line to be bound to the center of each ellipse. Is it possible to do this in XAML databinding or will I have to manually move the end of the line around in code?
While I haven't tried it, you may be able to achieve something using an ElementName Binding to bind between the Canvas.Top (and Left) properties of the ellipse and the line. You'll probably need a converter to offset that to center of the ellipse.
精彩评论