In my project, I want to be able to update the tabitemheader without giving that tab focus. It appears that calling INotifyPropertyChanged method to update the UI is causing that tab to receive focus. Is there a way to update an inactive tab without the tab receiving focus?
Thanks,
JON
I can't think offhand of any reason why that would cause the tab to receive the keyboard focus. Maybe the element being changed is causing a RequestBringIntoView which the TabGroupPane might be interpreting as a need to change the selected tab to that index which would cause it to take keyboard focus if the other tab within the tabgroup had keyboard focus. You could try using Snoop to see if that event is being triggered. Perhaps you could catch that event and mark it handled before it gets to the tab (assuming that is what is happening here).
This is my setup, so I am using the DocumentContentHost method.
<dockManager:DocumentContentHost ActiveDocumentChanged="DocumentContentHost_OnActiveDocumentChanged" x:Name="MyDocumentContentHost">
So I am overriding the Template for a PaneTabItem because I needed rename tab header ability through double-clicking the header. Things seemed to be working fine after that change.
I have also added a progress bar within the PaneTabItem docked to the top of the tab header. This is where I am having difficulty. There is a command within the tab's content that allows the user to start a simulation. Then they can go to another tab and start a different simulation regarding information on that tab. With the progress bar, it is blue while working and then when it is completed, the progress bar turns green until the user clicks on that tab, then the progress bar becomes hidden.
The problem is that when the simulation on the first tab finishes, the first tab receives focus even if the user is working on something on another tab. I am creating some results that are calling to the UI to update the results. Would this cause the first tab to receive keyboard focus?? I will create a sample for you soon.
There are 2 related ActivePane type properties. The ActivePane property of the xamDockManager essentially returns the ContentPane which contains the keyboard focus. The ActiveDocument of the DocumentContentHost represents the ContentPane within the DocumentContentHost that is active. The ActiveDocument doesn't necessarily have keyboard focus within it - you can have a different docked, unpinned or floating ContentPane that is the ActivePane that has keyboard focus or keyboard focus can be outside the DocumentContentHost. But if you have a ContentPane within the DocumentContentHost and it contains the keyboard focus then it will be both the ActivePane and ActiveDocument.
To answer your specific question, the ActiveDocumentChanged is raised when the ActiveDocument of the DocumentContentHost changes. That can happen for many reasons. E.g. If the selected tab of a TabGroupPane containing the ActiveDocument changes, if a ContentPane within the DCH gets keyboard focus (in which case it will be both the ActivePane and the ActiveDocument), if the ContentPane that is the ActiveDocument is removed from the DCH or hidden, etc.
What property of the tab are you changing that is causing it to get keyboard focus? Do you have a sample that demonstrates the issue?