Is there an event that gets sent when a pane is pined/unpinned? I have several windows that I would like to "disable" when they are pined and re-enable when they are pinned. I would also be interested in an event that gets sent when the panel is revealed; i.e., when it slides out from the pined area to allow the user to pin it.
how would this work for a ContentPane created dynamically?
so ContentPane pane = new ContentPane();
I've tried ContentPaneEvents.AddPinnedHandler(pane, OnPanePinned);
but the event doens't seem to fire when the pane is pinned/unpinned
I have just implemented your suggestion also but had a slight problem.
The Pinned and Unpinned events did not appear for the ContentPaneEvents (I got the error "The property ContentPaneEvents.Pinned does not exist in XML namespace..." when compiling)
However, I resolved the problem by changing
public static void AddPinnedHandler(UIElement element, RoutedEventHandler handler) { element.AddHandler(PinnedEvent, handler); }
to:
public static void AddPinnedHandler(DependencyObject d, RoutedEventHandler handler) { (UIELement)d).AddHandler(PinnedEvent, handler); }
and repeating the same change for RemovePinnedHandler, AddUnpinnedHandler and RemoveUnpinnedHandler.
Thanx.
No there isn't any information specific to those actions currently exposed. You should submit a suggestion and include as much detail about the requirements as possible.
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Thanks. That worked great! I was able to implement the suggested attached behavior for pinned and unpinned events. Now I have been told I also need to catch Flyout and FlyIn events - when the window pops out to allow the user to pin it and when the user unpins it and it slides back over to the tab. I see where I can specify a flyout type but is there a similar thing on XamlDockmanager that can be used to raise fly events?
In the snippet I provided, Unpinned and Pinned are routed bubble events raised on the ContentPane so you need to define local handler as you would for other events.e.g.private void OnPaneUnpinned(object sender, RoutedEventArgs e){ }private void OnPanePinned(object sender, RoutedEventArgs e){ }