29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
using MainModule.Views;
|
|
using System.Reflection;
|
|
using UIShare.GlobalVariable;
|
|
|
|
namespace MainModule
|
|
{
|
|
[Module(OnDemand=true)]
|
|
public class MainModule : IModule
|
|
{
|
|
public void OnInitialized(IContainerProvider containerProvider)
|
|
{
|
|
IRegionManager regionManager = containerProvider.Resolve<IRegionManager>();
|
|
regionManager.RegisterViewWithRegion("ShellViewManager", typeof(MainView));
|
|
}
|
|
|
|
public void RegisterTypes(IContainerRegistry containerRegistry)
|
|
{
|
|
containerRegistry.RegisterForNavigation<MainView>("MainView");
|
|
containerRegistry.RegisterForNavigation<AutomatedTestingView>("AutomatedTestingView");
|
|
containerRegistry.RegisterForNavigation<ProtocolStartView>("ProtocolStartView");
|
|
// Scoped: one ScopedContext per container scope.
|
|
// AutomatedTestingViewModel creates its own scope (IContainerExtension.CreateScope)
|
|
// and resolves the 5 child VMs from it, so all siblings inside one parent share
|
|
// the same ScopedContext, while different parents get isolated instances.
|
|
|
|
}
|
|
}
|
|
}
|