Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
XamDockManager change tab event
posted

Hi Support,

We are using the XamDockManager as the region manager like this:

<igDock:XamDockManager Grid.Row="1" Grid.ColumnSpan="2">
<igDock:DocumentContentHost>
<igDock:SplitPane>
<igDock:TabGroupPane prism:RegionManager.RegionName="{x:Static core:RegionNames.Test}">
<igDock:TabGroupPane.Resources>
<Style TargetType="{x:Type igDock:ContentPane}" BasedOn="{StaticResource DefaultContentPaneStyle}">
<Setter Property="AllowClose" Value="False" />
</Style>
</igDock:TabGroupPane.Resources>
</igDock:TabGroupPane>
</igDock:SplitPane>
</igDock:DocumentContentHost>
</igDock:XamDockManager>

We'll add several tab to this dock manager in the view model. Now we have one new requirement: Do some actions once user select certain tab(not every tab).

How to achieve this?

thanks,

Eric

  • 34810
    Suggested Answer
    Offline posted

    Hello Eric,

    Thank you for your post!

    To do this, I would recommend that you handle one of two events. These two events are the SelectionChanged event on the TabGroupPane or the ActivePaneChanged event on the XamDockManager. Both of these events will allow you to check the newly activated pane and perform your actions that you need to perform on certain tab selections.

    You can check the newly activated pane from the event arguments of both of the event handlers from these events. The e.NewValue property of the XamDockManager.ActivePaneChanged event will give you this, as will checking the e.AddedItems collection of the TabGroupPane.SelectionChanged event. If you check these panes in an if-statement in these event handlers, you can choose whether or not to perform your action on that particular content pane's activation.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support