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 don't want to limit the number of items displayed if htey are all displayed. Otherwise if I later add a new item it will be hidden by default for the user (most users won't use the feature or even know it's there).
I didn't see anything about the control persistence framework. I'm using v9.2.
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,
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?