Hello. I have a xamdockmanager with several SplitPanes and one ContentPane per SplitPane. I need to fire an event when a user clicks on the header of the ContentPane. This is how I'm assuming you would do this:
<igWPF:XamDockManager LayoutMode="FillContainer" Background="LightBlue" >
<igWPF:XamDockManager.Panes>
<igWPF:SplitPane Name="HendaySplitPane">
<i:Interaction.Triggers> <i:EventTrigger EventName="MouseEnter" > <mvvmlight:EventToCommand Command="{Binding OnHendayPaneFocusCommand}" PassEventArgsToCommand="True" /> </i:EventTrigger> </i:Interaction.Triggers>
content pane stuff
</igWPF:ContentPane> </igWPF:SplitPane>
</igWPF:XamDockManager.Panes> </igWPF:XamDockManager>
For EventName I've tried GotFocus, MouseLeftButtonUp along with several others but the event never fires. How can I set this up? Also ideally I would like to put Interaction.Triggers at the xamdockmanager level and have it pass the name of the content pane that got the focus. Thanks
Hi Kris,
You're welcome. Let me know if you have any further questions regarding this matter.
I was using breakpoints to determine this, yes. You are right, i can see the console.writeline() statement only executing once. Thanks for the explanation. I appreciate it.
Hello Kris,
I only see the event firing once on a single pane focus. Are you using a breakpoint inside of your command in order to determine this? One thing you have to keep in mind is that ActivePaneChanged is going to fire every time the XamDockManager.ActivePane property is changed. This property changes not only when you click on different ContentPanes, but it also changes when the XamDockManager loses focus, or the entire window itself loses focus. When the dock manager or the window loses focus, the ActivePane is set to null.
So if you are using breakpoints inside the command, when the event fires it causes Visual Studio to gain focus which sets the ActivePane to null, then if you try to continue the breakpoint is hit again because of the null. This creates a situation where the ActivePane is constantly being set between null and a ContentPane which causes the event to constantly fire. Place a Console.WriteLine() inside your command and remove the breakpoint and you'll see it only fires once.
There is another issue. Please have a look at the attached project. The ActivePaneChanged event actually fires like 20 times on a single pane focus. Your help is really apreciated.
I'm glad that helped. Let me know if you have any further questions regarding this matter.