/// <summary>
 /// Initializes a new instance of the <see cref="ViewModelContainerInitializerAttribute"/> class without a view model.
 /// </summary>
 /// <param name="registerForRegionNavigation">Register for region navigation; when Yes registers the view with the container using Object to view type mapping; when No, registers the view type with the container.</param>
 public ViewModelContainerInitializerAttribute(RegisterForRegionNavigation registerForRegionNavigation = RegisterForRegionNavigation.Yes)
 {
     this.RegisterForRegionNavigation = registerForRegionNavigation;
 }
        static void RegisterWithoutSettingDataContext(IUnityContainer container, Type type, RegisterForRegionNavigation registerForRegionNavigation)
        {
            switch (registerForRegionNavigation)
            {
            case RegisterForRegionNavigation.Yes:
                container.RegisterType(typeof(Object), type, type.FullName);
                break;

            case RegisterForRegionNavigation.No:
                container.RegisterType(type);
                break;
            }
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewContainerInitializerAttribute"/> class.
 /// </summary>
 /// <param name="viewModel">The view model.</param>
 /// <param name="registerForRegionNavigation">Register for region navigation; when Yes registers the view with the container using Object to view type mapping; when No, registers the view type with the container.</param>
 public ViewContainerInitializerAttribute(Type viewModel, RegisterForRegionNavigation registerForRegionNavigation = RegisterForRegionNavigation.Yes)
 {
     this.ViewModel = viewModel;
     this.RegisterForRegionNavigation = registerForRegionNavigation;
 }