Hi,
I'm dynamically loading views inside the XamWebOutlookBar. It works great and I've got no issue with it.
I'm now tasked with saving the state of the XamWebOutlookBar accross sessions. If the user drags the splitter down and shows less groups, I've got to save this number (it's the NavigationAreaMaxGroups property AFAIK).
Unfortunately, I can't see any event triggering the change of the property value.
I tried listening on the NavigationAreaGroups.CollectionChanged but it will be called when I dynamically add the views to the outlookbar as well as when the user drags the splitter.
Is there an event I'm missing or is there a good way of saving this NavigationAreaMaxGroups so that the user will see the same visible groups on the new session?
Cheers.
I think I solved the issue.
I listen on the NavigationAreaGroups.CollectionChanged event and save the NavigationAreaMaxGroups each time:
userState.MaxNumberOfNavigationItems = _hostControl.NavigationAreaMaxGroups == _hostControl.Groups.Count ? -1 : _hostControl.NavigationAreaMaxGroups;
Is this the best approach?
How about just:
userState.MaxNumberOfNavigationItems = _hostControl.NavigationAreaMaxGroups
You might also want to look at our Control Persistence Framework - you should be able to save the state of your application with it and then restore it in another session.
HTH,