When un-docking a tab (ContentPane) the tab that is selected is not the last selected tab.
For example, if there were 4 tabs ( A, B, C y D).
It is always the tab selected before the last one that gets selected. This is not consistent with Visual Studio Behavior.
Is this a bug? Can the XamDockManager be configured so the tabs get selected correctly, and always the last tab is the one left selected on the group?
Thank you!
Hello Dzyann,
I have confirmed with my colleagues that this is indeed a development issue in need of fixing. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a development ID of 193633.
I have created a private case for you so that you can continue to track the progress of this development issue. The case ID is CAS-155254-Q7X1V4 and you can access it here: https://es.infragistics.com/my-account/support-activity.
Regarding the usage of several TabGroupPanes, I believe for this workaround to work, you will effectively need to implement the workaround separately on each TabGroupPane that you have in your project. One way you could do this is to create a custom class that derives from TabGroupPane. If this class handles the SelectionChanged event, it will be essentially built in to your custom TabGroupPane.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hi Andrew, thanks for taking time to looking into this.
I agree with you, I think this is a bug.
I appreciate the workaround. The one setback is that we have several TabGroupPanes and also my application is used as sort of a base application by other apps. If they add their own groups they will have the same issue and have to implement this workaround.
Do you have any thoughts on this?
It appears that this issue is being caused because the TabGroupPane is raising two "selection changed" notifications when you float a pane when the TabGroupPane is hosted in a DocumentContentHost. I have found that the previous pane is being selected correctly at first, but then on the second call, the next-previous pane gets selected, and this happens too quickly to see, so it appears that just the next-previous pane is the only one being selected.
After some research and investigation, I have devised a workaround for this behavior. You will need to keep track of the tabs that are selected for this to work, and to do that I would recommend creating a List<ContentPane> and handling the SelectionChanged event on the TabGroupPane. If the item at e.AddedItems[0] is not null and is a ContentPane, add it to this collection. Then, using a Dispatcher, you can check the e.RemovedItems collection. If e.RemovedItems[0] is not null, is a ContentPane, and the panes location is PaneLocation.Floating, then the user has floated one of the tabs of the TabGroupPane. At this point, the double "selection change" will have already happened, so the pane that you want selected will be at the index of ListOfContentPanes[ListOfContentPanes.Count - 2]. You can then set the TabGroupPane.SelectedItem property to the content pane at that index and your last-selected content pane will be selected on float of a tab in the TabGroupPane.
I have attached a sample application to demonstrate the above. I am also continuing to investigate this matter to determine if this is a bug or not. I believe it likely is, but I would like to make sure.
Thank you for your post. I have been investigating into this issue, and I have reproduced the behavior that you are referring to. Interestingly, it only appears to exist when the TabGroupPane is hosted in a DocumentContentHost in the XamDockManager. I will be investigating into this a bit further with my colleagues and I will have more information for you very soon on this matter.