Problem with Backstage tab items

Jun 30, 2010 at 4:56 PM
Edited Jun 30, 2010 at 4:56 PM

I'm having some issues with backstage tab items. The backstage appears to be allowing click events to 'leak' through to another tab...

Because my backstage is being populated in code (I'm pulling in a list of recently opened files from My.Settings and creating a TabItem for each one inside a BackstageTabControl parent), instead of adding handlers for each TabItem, I thought it would make more sense to hang code off the parent BackstageTabControl and then work out which item was clicked from there using the SelectionChanged event and checking the IsSelected property for each TabItem. This then causes the application to load the file and then switch out of the backstage and into the main tab.

However, if I select a tab at the very top of the list (which overlaps where my Ribbon buttons would normally appear on the main tab), as it switches out to the main tab the Click event that was obviously raised when I clicked on the BackstageTabControl is passed through to the main tab and hits whichever button is underneath the cursor at the time.

Now, should I be doing this in a different way, is it a quirk with WPF or a bug with the ribbon control? Surely the click event should be being handled before it gets this far...

Thanks in advance for any help.