What's the equivalent of this winform instruction:
this.button1.Click += new System.EventHandler(this.button1_Click);
in WPF ?
Update: also for a slider. And what namespace should I declare ?
My point is NOT to use XAML.
Right-click the control for which you want to handle the notification event. On the shortcut menu, choose Add Event Handler to display the Event Handler Wizard. Select the event in the Message type box to add to the class selected in the Class list box.
The UIElement. AddHandler method, together with the AddressOf operator to reference the event handler.
Something like this...
this.btnTest.Click+=new RoutedEventHandler(btnTest_Click);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With