My Application is adding contentPanes to tabGroupPane via tabGroupPane.Items.Add(contentPane);Afterwards I select the tan via tabGroupPane.SelectedItem = contentPane;
These 2 operations take forever to execute.tabGroupPane.SelectedItem = contentPane; orcontentPane.Activate();
Is there a more efficient way to select a tab withing a tabgroupPane?
I've seen a number of posts regarding slowness with XamDockManager switching tabs and that there was a hotfix. I'm using Infragistics version 17.2. It can take up to 5 seconds to switch tabs which is unacceptable. Any suggestion is appreciated.
Thank you for posting. Refer this online help document, this is how we add contentPanes to tabGroupPane .I created a sample and it is not taking much time.
The best way for us to assist you is if you provide a small isolated sample that we can run and use for debugging locally.
Looking forward to hear you back.
Sincerely,Divya JainAssociate Software Developer
I know how to add a content pane. That is not my issue. The issue is as I said above, when the contentPane is activated, it is taking a huge performance hit. Creating a small sample project is not realistic as it will not depict the performance in a real live environment.
There are these 2 posts which discuss the issue and it mentioned this issue was addressed in development.
Can you please suggest a work-around to this issue?
Neither of the posts you refer to were bugs in the xamDockManager. The first post asks about the loaded/unloaded events that are raised as the tabs are changed. This is not something the xamDockManager controls. Those are WPF events and are raised by the WPF framework as an element enters/leaves the visual tree and as it enters/leaves the logical tree. That can happen in a number of scenarios in the xamDockManager - e.g. pinning/unpinng, floating/docking/dragging and changing the selected tab. The latter is just a by product of how the MS TabControl works. The TabGroupPane is just a derived MS TabControl. The MS TabControl only keeps the Content of the selected tab in its visual tree. So when you select another tab they remove the content of the old selected tab from the visual tree and they add the content of the newly selected tab to the visual tree and therefore the unloaded event of the old element(s) and the loaded event of the new elements are fired.
The second post is talking about when the elements of a DataTemplate are created. The elements of a DataTemplate are (typically) created by the WPF ContentPresenter. It wasn't clear in the post where they were using/setting the DataTemplate but presumably it was as the ContentTemplate of the ContentPane. The ContentPane is a ContentControl and so has a ContentPresenter within its ControlTemplate that is using the ContentTemplate. If the template of a contentcontrol is changed then the old ContentPresenter would release its elements when it was released and the new ContentPresenter within the new ControlTemplate would create the content from the DataTemplate provided. So if the template of the ContentPane was changed and one was using the ContentTemplate then the elements for that would be recreated. They didn't provide a sample but it seemed like one possible case for that would be if they set the Theme property of the xamDockManager because in that case there would be a style for the ContentPane that would only be applied by the WPF framework while its within the visual tree of the dockmanager. As it leaves/enters the visual tree, the WPF framework might find a different Style for the element and so the template would be recreated.
So if you are experiencing an issue when changing tabs it could be a number of things and without a sample its hard for us to offer any concrete guidance. Perhaps you have some expensive/time consuming code triggered from the loaded event. If that's the case then perhaps one might unhook the event after the Loaded event was fired the 1st time or they might keep a flag and not perform that action in response to subsequent raising of that event. Or one might have performance issues result because they have a very heavy element tree since the WPF framework has to traverse the entire tree raising those events, changing inherited dependency property values, etc. If the issue is similar to the 2nd post then one might do as I mentioned in the reply to that one and set the Content of the ContentPane to be a ContentControl and set the ContentTemplate of that to their DataTemplate because the ControlTemplate of that ContentControl wouldn't be changing as the ContentPane's ControlTemplate was changed. If you cannot provide a sample then I would suggest profiling your application to see where the time is spent when the tab is changed.