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.
There currently isn't an event specific to pinning/unpinning. You could bind to the pane's IsPinned state to know when it has changed. With regards to when the UnpinnedTabFlyout is displayed, there is no event associated with this action. You should submit a suggestion for adding these events.
I have entered the suggestion.
In the meantime could you elaborate on "bind to the pane's IsPinned state"? I thought that there had to be a PropertyChangeEvent for me to connect to in order to be notified of the change? I am using Infragistics.Windows.DockManager.ContentPane which does not seem to support a property changed event. I looked into using a trigger but once again ran into the requirment of a notifying event. Of course I could be misreading the whole thing, in which case I would welcome guidance.
I meant that you could use a Binding to bind the IsEnabled or other property on your windows/controls to the IsPinned property of the content pane. e.g. assume leftTop is a contentPane
Another option would be to create an attached behavior that raises a Pinned/Unpinned event. E.g.
Then the usage would be something like the following (assumes local is mapped to the namespace you put this class in):
Hi,
I want to achieve similar functionality. i had tried this Code but i am not getting Pinned and unpinned event in XAMl. please help
Hello,
Thank you for the provided information. I believe that other community members may benefit from this.
Thanks again.
Another easy solution would be this one:
// Works only for pinning because unpinned panes are not in the same visual tree.
dockManager.AddHandler(ContentPane.ExecutedCommandEvent, new EventHandler(OnCommandExecuted));
// This will cover both events, but requires that each content pane gets an event handler assigned.
ContentPane dockContent = new ContentPane(); dockContent.ExecutedCommand += this.OnCommandExecuted;
private void OnCommandExecuted(object sender, ExecutedCommandEventArgs e) { if (e.Command == ContentPaneCommands.TogglePinnedState) { // Do something. } }