I have an UserControl that contains a Button:
<UserControl>
<Button>
</UserControl>
I want to handle the Button events (like Click, Loaded, …), for example to use:
MyUCtrl.Click += new RoutedEventHandler(MyUCtrl_Click);
that is equivalent to:
MyButton.Click += new RoutedEventHandler(MyUCtrl_Click);
How can I do?
Redeclare the event on the UserControl, subscribe to the Button’s event internally and raise the event of the UserControl in the handler.