添加项目文件。
This commit is contained in:
28
MainModule/MainModule.cs
Normal file
28
MainModule/MainModule.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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.
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user