Adding event handlers via ContentPaneProxy

Jul 28, 2009 at 2:57 PM
Edited Jul 28, 2009 at 3:10 PM

I'm trying to add an event handler to a ContentPane via ContentPaneProxy:

contentpane_style.Setters.Add(new EventSetter(
new RoutedEventHandler(ContentPaneLoaded)));
(DependencyObject)view, contentpane_style);

Why doesn't my ContentPaneLoaded() event handler get triggered?

Aug 6, 2009 at 5:49 PM

According to ncal doumentation,

EventSetters in a Style applied to Proxy element will not be applied to events on the actual element, but the proxy element.  Since a proxy is never shown on the screen, most events on the proxy are never raised.  For certain key events, the proxy will re-expose it and raise the event as necessary, such as the Closed event of a ContentPaneProxy.