HiI wish to use either xamOutlook bar or xamRibbon in combination with TabControl. A master detail implementation. Is it possible to hide the actual tabs themselves. Or is there better control to use other than the xamTabControl? Hope that makes sense. To further explain. I wish to have the behavior of having the detail panels change depending on what the user is trying to do.
Thanks
Until support can get back to you next week, I found the following webpage that talks about how the WPF TabControl actually re-uses the same elements instantiated by a DataTemplate for each TabItem.
http://stackoverflow.com/questions/1965355/how-to-add-new-user-control-in-tabcontrol-contenttemplate
I had not heard of that behavior. This is going to be a problem for the XamOutlookBar as I do not think it is expecting to be re-initialized when the selected tab changes. When support comes through you can explain that the XamOutlookBar not supporting this WPF fearure could be considered the bug.
This means to get this to work you need to have two XamOutlookBar elements instantiated for the two TabItems. If there is a way to turn off the virtualization of the TabControl, that might be the solution. However, you may need to programmatically instantiate two TabItems with two XamOutlookBar elements and then assign the appropriate binding expressions.
Once support gets a hold of you you can explore further ideas. However, since you said this was critical, I suggest the above example as it will ensure that you have two XamOutlookBar elements that stay around in memory when the user switches tabs.
Hello Prayag,
So far I have not been able to figure out what is going on. I have created a developer support case for you so that a support engineer might help you explore this issue further.
The case numner is CAS-51708-321BM1
Thank you,
Hi Curtis,
Sorry for bugging you but this has become a critical issue for us. Any updates on this one?
Prayag
As you mentioned indeed only one XamOutlookBar is being instantiated for any number of tabitems. What i would like to add into this is it is not an issue with the xaml but virtue of the UI Virtulization feature. So for all datatemplates this happens but if you add tabitems statically in teh markup instead of supplying ItemsSource then each tabitem will use different instance.
Now to the real issue, even though the same instance is being used across tabteims, on datacontext change one expects that all data and bindings should be reinitailized and which happens as noted by you and appearent in the sample. But to me the issue is selected group being set to null upon switching between tabitems. It looks like somewhere the binding arenot getting cleared or the property chagne evetn is not being handled correctly or some misunderstanding on my part.
In any case i greatly appriciate your help and quick response, hoping to hear about some resolution on this from you soon.
For some odd reason only one XamOutlookBar is being generated and appears to be applied to both TabItems even though the correct data for each tab is being applied to the OutlookBar on switching tabs. This might be the source of the problem. The ItemsContainer style and the DataTemplate looks fine. Also, I can replicate the problem of only one element being generated with any element I add to the TabItem DataTemplate, so this appears to possibly be a XAML syntax problem or bug and not specific to the XamOutlookBar. However, I have asked the lead engineer for the XamOutlookBar to look into this to see if he sees why this problem would be occurring.
I will get back to you as soon as I hear back from him. Thank you for the sample project, it has helped us see the problem perfectly!
Sincerely,