Hi,
Is there any way i can externally select which group/internal group in the xaml outlookbar is selected. So what is want is to be able to navigate and select a particular group or inner group(say Mail/Favourite/Inbox) without clicking around with mouse. I should be able to set the said item thorugh some binding or command.
Thanks
Prayag,
Sorry for the delayed response. I have been looking into this. I think this is the expected behavior. I am seeing the same behavior if you replace the XamOutlookBar with a TabControl. If you change the itemssource of the TabControl it will again reset all bound IsSelected properties to false. The only difference is that when you switch back to the old itemssource, the first tab of the TabControl will be selected (in contrast the XamOutlookBar does not select the first group).
Can you please give us more information on the converter. I could not find any xaml code using a converter.
One more issue i am facing is that the converter is being called multiple times when is switch between tabitems showning the xamloutlookbar. So if i have tabitem1 and tabitem2 then when i go for item1->item2 the converter is alled only once which is correct but now when i go from item2->item1 the converter is being called 5 times and if i again go to item1->item2 it is called 5 times but now if i again go to item2-item1 the converter is called 9 times .... this keps on increasing.
I am not registering any event handlers but i guess cause of the UI virtulization of WPF the xamloutlookbar is somehow not flushing the subscribers for the selected change event. Please help
Prayag
Hi Alex,
Thanks for the reply. I do agree that that the groups should reinitialize with the new source list from the latest datacontext. But what i would expect is that reinitializing the source with a new list sould not cause a change in the state of the objects of the current source list. So what i am probably trying to say is that binding between the groups and source items should be first broken before dispatching them. Please correct if i am missing a point here.
When you change the DataContext, are you changing the items source of the XamOutlookBar? If you do, then it is expected for the groups to reinitialize and therefore IsSelected become false.
What you can do, is to handle the DataContextChanged event and ensure that you select a new group when the itemssource changes.
I am facing one more issue with the xamloutlook bar. I am binding a list of items to the xamoutlookbar as its source. The objects in the list have a property IsSelected which i bind to the IsSelected property of the outlookbarGroup. Now whenever the datacontext of this xamloutlookbar changes the currently selected item's isselected property is set to false. Also i have an additional property for SelectedGrgoup whose isselected property is also set to false. What i vl expect is that even if the Datacontext changes the property sholud not be set to false as i never deselected the group.