Sonja
Sonja

Reputation: 595

adding event handlers on dynamically created WPF controls

I have a WPF application and it is using dynamic WPF controls. How do I add event like button or image OnResize?

Thanks

Upvotes: 1

Views: 882

Answers (1)

mm8
mm8

Reputation: 169160

You could hook up an event handler to an event of the Button or Image using the += syntax:

 Image image = new Image();
 image.SizeChanged += (s, e) => { /* handle event */ };

Upvotes: 4

Related Questions