I have a Usercontrol (UC1) which contains a list of other UCs (UC2), i want to raise an event in my UC2 when something is modified in it and catch it in UC1, so i declared it like that :
In my UC2 Class :
public static readonly RoutedEvent LiaisonModifieeEvent = EventManager.RegisterRoutedEvent(
"ModificationOccured", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(UC2));
In the consructor of my UC1 Class :
this.AddHandler(UC2.LiaisonModifieeEvent, new RoutedEventHandler(ModificationOccuredEvent_Handler), true);
And the declaration of my handling method
private void ModificationOccuredEvent_Handler(object sender, RoutedEventArgs e)
{
e.Handled = true;
SaveCablingLinkButton.IsEnabled = true;
}
Seems that i'm missing something, but i can't see what, the event never is catched in UC1.
EDIT : i forgot to mention the raising part
Somewhere in UC2
RaiseEvent(new RoutedEventArgs(UC2.LiaisonModifieeEvent, this));