//File:Window.xaml.cs using System; using System.Windows; using System.Diagnostics; using System.Windows.Shapes; using System.Windows.Input; namespace WpfApplication1 { public partial class Window1 : System.Windows.Window { public Window1() { InitializeComponent(); myEllipse.AddHandler(Ellipse.MouseDownEvent,new MouseButtonEventHandler(MouseDownEllipse)); myEllipse.AddHandler(Ellipse.PreviewMouseDownEvent,new MouseButtonEventHandler(PreviewMouseDownEllipse)); }