Hello
I'm having the following problem.
I want to implement ribbon-based app with ribbon tabs as separate MEF component which can also contain MEF components - ribbon groups.
In my shell.xaml I have following code:
If I'm removing my ribbon tab group component, evertything works fine - I have an empty tab inserted into ribbon on my Shell window.<ribbon:Ribbon x:Name="Ribbon" cal:RegionManager.RegionName="AplicationRibbonControl"> ........</ribbon:Ribbon>For my Tab components I have following code in XAML:And for my ribbon tab group component:<ribbon:RibbonTab x:Class="FI.VMRT.ObjectsTabUI" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" xmlns:cal="http://www.codeplex.com/prism" xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" x:Name="ObjectsTab" Header="Objects" cal:RegionManager.RegionName="ObjectsTabControl"></ribbon:RibbonTab>And while loading the application in my ribbon tab modude when I'm calling this:<ribbon:RibbonGroup x:Name="PlacementGroup" Header="Placement" x:Class="FI.VMRT.PlacementGroupUI" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" xmlns:alp="clr-namespace:FI.Family.AkerLogoPack;assembly=AkerLogoPack" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"><Grid> .... controls here .......</Grid></ribbon:RibbonGroup>_regionViewRegistry.RegisterViewWithRegion("AplicationRibbonControl", typeof(ObjectsTabUI));I'm getting the following error:An exception has occurred while trying to add a view to region 'AplicationRibbonControl'. - The most likely causing exception was was: 'Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type ObjectsTabUI, key "" ---> Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type ObjectsTabUI, key "" at Microsoft.Practices.Prism.MefExtensions.MefServiceLocatorAdapter.DoGetInstance(Type serviceType, String key) at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) --- End of inner exception stack trace --- at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType) at Microsoft.Practices.Prism.Regions.RegionViewRegistry.CreateInstance(Type type) at Microsoft.Practices.Prism.Regions.RegionViewRegistry.<>c__DisplayClass1.<RegisterViewWithRegion>b__0() at Microsoft.Practices.Prism.Regions.Behaviors.AutoPopulateRegionBehavior.OnViewRegistered(Object sender, ViewRegisteredEventArgs e)'. But also check the InnerExceptions for more detail or call .GetRootException().
Can someone please give me a hint, why this error occurs when I'm trying to add nested component?
Thank you!