In order to add click event in the Generic.xaml of your custom control you can do the following:
- Set x:Name on your Button
- Override the OnApplyTemplate() method of your control
- Inside the method, get the Button with the GetTemplateChild() method
- Add click event to the Button
Here is an example:
Button btn = (Button)
btn.Click += btn_Click;
I hope this helps.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.