0

I have defined a user control to represent a tab item comprising of a few buttons. When I create an instance of the user tab item I would like to define click handlers for button clicks. e.g. for

<TabItem >
   <my:Tab1/>   
</TabItem>

For Button1 and Button2 within Tab1 I would like to define something like

<TabItem >
    <my:Tab1 Button1:Click="button1_Click" Button2:Click="button2_Click"/>
</TabItem>

Naturally, the above doesn't work. Does anyone know how I can achieve this.

Thanks in advance.

user1400716
  • 1,126
  • 5
  • 13
  • 32

1 Answers1

0

It can be done by routed events on you user control that rise buttons click event handler or by using commands. This is probably a same case as yours

Community
  • 1
  • 1
HichemSeeSharp
  • 3,240
  • 2
  • 22
  • 44
  • Thanks for the quick response. So in Tab1::button1_Click() I raise a routed event? How do I declare a handler in my main application that owns the instance of the user control? – user1400716 May 29 '13 at 23:51