I'm pretty new to silverlight so, i'm having this problem about communication between user controls. I have user controls that have buttons in them which are supposed to set some properties of other user controls. For example, IsEnabled property to be set as true or false or visibility, and so on. I actually know one solution which would be something like:
class UserControl1 : Usercontrol
{
public UserControl2 uc2;
private void Button1_Click(object sender, RoutedEventArgs e)
{
uc2.IsEnabled=False; // or uc2.SomeMethod();
}
}
Similar goes for UserControl2 class, and then in main page i only add:
UserControl1.uc2=UserControl2;
My questions is, how can i do this via Event Handlers? Or maybe there is some othe better solution? A simple example would be welcome. Thanks.