views:

49

answers:

1

Lets say I create a user control with a button for a silverlight navigation app. I want to use this user contol on several pages. Each of the pages has a function called

void changecolor() { //process request }

When the user clicks the button I want it to call the changecolor() function. Any ideas on how to do this?

A: 

You could create an event at the UserControl that the page subscribes on. When the event is fired the method is triggered.

UserControl1.ButtonClicked += (se, ea) => changecolor();
xamlgeek
Thanks,That worked.
Weston Goodwin