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
Try thisDim grp As OutlookBarGroup = Menu.Groups("Personlig")Menu.SelectedGroup = grpMenu is the name of the xamOutlookbarPersonlig is the key on the group
How can i do two way binding for the SelectedGroup property of the Xamoutlookbar conttrol ? I have a list of person bound to the Source property with some datatemaplte. Now when i bind SelectedGroup to a property of type Person on my viewmodel the binding breaks giving an error about conversion between OutlookBarGroup and person object. Can you please help me on tjhis one??
Thanks in advance
I can see what You try to dobut I dont think You can bind Your person directly to Outlookbar groupI think You need a converter
or You could loop throu Your persons in code behind and insert a group for each person
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.
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.
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.
Prayag
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
Just wanted to know if you managed to find anything on my issue?
Actually all i am doing is trying to use the XamlOutlookbar in a tab control and maintain selection across tabs. I have the SelectedGroup bound to the SelectedGroupTarget property of my ViewModel. So even if I accept that hte selection will be gone and i need to somehow maintain it in my vm its of no use as i am still facing issue.
When i have a single tabitem all is fine and i can easily navigate between Groups with no issue. But as soon as I add more than one TabItem and then when i switch between 1->2->1 adn then try to navigate between groups the SelectedGroup becomes Null :(. I am really caught up with this one and see no way out of this. On Navigating to other group the convertor's ConvertBack for the SelectedGroup is fired first and then it in turn calls the setter of the Vm.SelectedGroup properrty. All is well and the value is correct, now i the PropertyChange event is fired from the setter and all hell breaks loose as somehow the converter's ConvertBack is called again and and this time the value is null for the selected group.
I need help badly on this on
Any updates on this one?
The code is as pasted below. I am not doing anything more that just using a converter for the selected group.
<
="Left"
=OneWay}"
}}"
="OutlookBar_Loaded">
>
}">
<!--<Setter Property="Visibility" Value="Collapsed" />-->
}" />
In the converter my convert back mentod just retrives the datacontext of the curretnyl selected group and converts it to the desired type.
NavigationGroupTarget
selectedTarget = null;
if (null != value)
{
OutlookBarGroup group = value as OutlookBarGroup;
if (null != group)
NavigationGroupTarget target = group.DataContext as NavigationGroupTarget;
if (null != target)
selectedTarget = target;
}
else
throw new ArgumentNullException("value");
return selectedTarget;
Please not the the issue i am facing is only with this convert back method which gets called multiple times and on switch between tabs this count increases.
Thanks for the help