How to refer to figure I clicked to change its properties and move it?
I have a figure in canvas in WPF application. This figure is generated by
program (I click a button and then a figure appears). How to order the
Figure_MouseLeftButtonDown function to change some properties of THIS
figure? Also I want to move this figure by dragging. Now I have something
like this: var ell = new Ellipse() { Name = "FirstEllipse", Width = 150,
Height = 100, Margin = new Thickness(200, 150, 0, 0), Fill = Brushes.Red
}; ell.MouseLeftButtonDown += Ellipse_MouseLeftButtonDown;
canvas.Children.Add(ell); private void Figure_MouseLeftButtonDown(object
sender, MouseButtonEventArgs e) { sender.SetValue(Ellipse.FillProperty,
Brushes.Aquamarine);}
No comments:
Post a Comment