The literature is awful in this regard - all I want to do is bubble an event up from a control that I have defined but created on the fly (hopefully this will not cause issues) from a broker controller class. The control is a PopUp.
public static readonly RoutedEvent weClosed = EventManager.RegisterRoutedEvent("TIMBOO", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(FixedTaskbarNotifier));
// Provide CLR accessors for the event
public event RoutedEventHandler TIMBOO
{
add { AddHandler(weClosed, value); }
remove { RemoveHandler(weClosed, value); }
}
// This method raises the Tap event
void RaiseTapEvent()
{
RoutedEventArgs newEventArgs = new RoutedEventArgs(weClosed);
RaiseEvent(newEventArgs);}
protected override void OnClosed(EventArgs e)
{
//TO DO - rearrange current open windows - fire event?
Log.Instance.Info("Clean up Window");
RaiseTapEvent(); This is called on close but nothing fires ..
}
I am hoping to catch the event somewhere - even in my parent window or higher up the visual tree. This has a reference to a controller that holds the list of notification controls -once I know which one was closed, I can reoganise / repaint any others still active via the controller, but how to catch? Thanks!