如何MouseLeftButtonDown
在 WPF 中定义程序生成的 Canvas 的 Ellipse 元素的事件处理程序?我有这样的事情:
canvas.Children.Add(new Ellipse(){
Name = "FirstEllipse",
Width = 150,
Height = 100,
Margin = new Thickness(200, 150, 0, 0),
Fill = Brushes.Red,
MouseLeftButtonDown = "Ellipse_MouseLeftButtonDown"
});