See, in our app, the shell contains an OutlookBar and the idea is that modules will register views that contain an OutlookBarItem. Okay, so the solution above works, but it's really just a work-around. Our issue is that this forces us to handle views that contain OutlookBarItems in a wholly different manner than all of our other views. Blech. Ideally, I should be able to simply register the view without the lambda silliness.
So any ideas on alternatives? Do I need to write a Region Adapter that will enumerate each OutlookBarItem in each item found in the NewItems list when items are added to a region? Does Telerik have a suggestion?
7 Answers, 1 is accepted
...and we were to try and write our Adapt() method as such...
Now we're treading into murky waters with the concept of "reassigning" the RadOutlookBarItem's parent. Blech.
Am I just way, way off base here?
I am not sure if I understand your issue correctly. You said that in this solution the OutlookBar views that contain OutlookBarItems are handled in different manner than all of your other views, but can you please elaborate on how you expect to handle the views?
I also attached a sample project illustrating a different approach for using the RadOutlookBar control in a PRISM scenario - a custom RegionAdapter is defined for the RadOutlookBar control. It might help you.
the Telerik team
That does the trick! The RadOutlookBarRegionAdapter was the key.
Our issue was with where the instructions showed registering the view with the lambda. We have an abstract base class for IModule that enumerates the types in the assembly and will either register a view with a region or register a type with the container based on attributes decorating the view's code-behind. Without the custom region adapter, we'd be forced to handle the view containing the RadOutlookBarItem some other way to accommodate the lambda. Fortunately, your region adapter eliminates that issue.
We all did a facepalm when we saw the Adapt() code (it seems so obvious now).
I've used your sample projects in order to populate OutlookBar with OutlookbarItems dynamically via PRISM. Unfortunately, with the latest update of Telerik WPF RadControls libraries (RadControls_for_WPF_2012_3_1129_Dev_hotfix, ver. 2012.3.1129.40), Ive come across problem with initial minimized state of all OutlookbarItems. (this issue has been discussed already, see http://www.telerik.com/community/forums/wpf/outlookbar/radoutlookbar-all-items-minimized-in-new-version.aspx). Can you please verify the status and possibly provide me with the solution? My goal is to have all OutlookbarItems visible by default (not in minimized state).
PS: In the sample project, I've used Windows8 theme
You can try setting the ActiveItemsCount property of the RadOutlookBar.
Pavel R. Pavlov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I'm having a hard time trying to adapt the given example to use IActiveAware view models. I suspect that SelectorItemsSourceSyncBehavior is broken when used with a RadOutlookBar. What i did:
1) I implemented IActiveAware in MainViewModel. At this point the IsActive property is being set to true for each view added since RadOutlookBarRegionAdapter returns AllActiveRegion as IRegion implementations. But that's not ideal, since only the selected item should be marked as active according to the default region adapter implementation for a tab control.
I tried to return a SingleActiveRegion instead, but that break the example since now the ActiveViews collection changed event now fires a reset signal, which can't be handled as the other events (both old items and new items are null, ActiveViews and Views are empty).
2) Removed the custom adapter to use the default one, adapted the views to be RadOutlookBarItem. Now the IActiveAware is being ignored and is always set to false.
Is this expected behavior? Am i doing something wrong? I mean i could handle the SelectionChanged event manually and indeed it works, but it feels like it should be done automatically by prism (and in fact it does in my production code with a similar control which i'm trying to replace with RadOutlookBar).
Please note that the provided example demonstrates a possible usage of PRISM in combination with our RadOutlookBar control. Extending that example actually is out of our support scope. This is why I recommend asking in other community driven online resources, like StackOverflof, for a solution. Please note that the RadOutlookBar control is actually an ItemsControl and in this case you need to use it in your custom project.
After a brief research I found out a post that may be helpful in your particular case.
Pavel R. Pavlov
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).