Adding event handlers via ContentPaneProxy

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

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

contentpane_style.Setters.Add(new EventSetter(
ContentPaneProxy.LoadedEvent,
new RoutedEventHandler(ContentPaneLoaded)));
XamDockManagerSettings.SetContentPaneProxyStyle(
(DependencyObject)view, contentpane_style);
docking_region.Add(view);

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

Aug 6, 2009 at 4: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.