Is there a way to sort the views that get added to a ItemsControl region? The views being added are registered with the container and added to the region in each unique module.
Some pseudo code...
Shell:
<Window>
<ItemsControl Prism:RegionManager.Region="ItemsRegion"/>
</Window>
Modules: This is the initialization code in the modules.
protected override void RegisterViewsAndServices()
{
CommonContainerLifetimeManager.Register<IView, ItemView1>();
Container.RegisterType<IViewModel, ItemViewModel1>("ItemViewModel1");
}
public override void AdditionalInitialization()
{
var itemView1 = Container.Resolve<ItemView1>();
RegionManager.Regions["ItemsRegion"].Add(itemView1);
}
With this approach it is showing the added views in the shell's itemscontrol in the order the modules are loaded. Based on the role of the logged on user different modules are loaded. Is there a way, without having to add a collection inbetween, to sort the itemscontrol.items on a property of the view's viewmodel for example? Is there a way to force the modules to be loaded in a certain order? I am currently using a module catalog.
Thanks
Andy