Hi
I have a tree and a XamDockManager (with a TabGroupPane) and I want to sync the user selection (e.g User selects a Tab, the tree changes selection)
Is there an event that I can tie into on either the TabGroupPane or the content (ContentPane) to pick up the selection changes.
I have used SelectionChanged but the AddedItems and RemovedItems objects also include the Child objects of the tab page itself. I could filter by type being passed in but it seems expensive
thanks
Martin
I see, so it is the underlying events from the child components I am seeing coming up through the ContentPane then to the TabGroupPane.
I was looking out for the Sender but that did not help, I now see (thanks to you) the OriginalSource is the place to filter.
goldingm said:The SelectionChanged event is on the Contrainer (TabGroupPane), I wanted the TabGroupPane to notfy me of pane selection changes, nothing to do with the knowledge of the ContentPane.
I was replying regarding your request for an event on the ContentPane regarding selection changes.
goldingm said: By this I mean the SelectionChanged Event from the TabGroupPane is raised against all children of the ContentPane as well, eg. the e.AddedItems contains the children of the ContentPane .. I was not expecting this.
By this I mean the SelectionChanged Event from the TabGroupPane is raised against all children of the ContentPane as well, eg. the e.AddedItems contains the children of the ContentPane .. I was not expecting this.
The SelectionChanged event is on the Contrainer (TabGroupPane), I wanted the TabGroupPane to notfy me of pane selection changes, nothing to do with the knowledge of the ContentPane.
> I'm not sure what you are referring to that would be expensive when handling the TabGroupPane
My solution, in my SelectionChanged delegate, I am filtering by Type of addedItem (I only need to know about the ContentPane changes, not any its children) and then setting e.Handled to true, I was after a better solution, seems like I am ok as I have done.
martin
The ContentPane really doesn't know anything about its container so it doesn't expose any event regarding a containing TabGroupPane's selection. With regards to TabGroupPane, the SelectionChanged of the base class is the only event that is invoked when the selection has changed. I'm not sure what you are referring to that would be expensive when handling the TabGroupPane. Also, you should be aware that if the end user is allowed to drag the panes out of the tab group, unpin a content pane, float it, etc. then the events of that specific TabGroupPane are not going to be raised since the group is never moved - only the ContentPanes within them.