コード例 #1
0
ファイル: PluginManager.cs プロジェクト: thabet-fix/ndoctor
 private void MapWindows()
 {
     ViewService.Configure(e =>
     {
         e.Bind <AddRelationView, AddRelationViewModel>()
         .OnClosing(vm => MvvmHelper.GetViewModel(workbench).Refresh());
     });
 }
コード例 #2
0
ファイル: DIConfig.cs プロジェクト: megolden/golden-framework
        public static void Register()
        {
            builder.Register(_ => Application.Current).As <Application>();
            builder.RegisterType <Shell>().AsSelf();

            //Services
            builder.RegisterType <ModalService>().As <IModalService>();
            builder.RegisterType <ApplicationService>().As <IApplicationService>();

            //Components
            //builder.RegisterInstance(App.Current).As<IApplication>().SingleInstance();

            //Views
            //Assembly.GetCallingAssembly().ExportedTypes
            //    .Where(t => t.IsClass && !t.IsInterface && !t.IsAbstract && typeof(IView).IsAssignableFrom(t))
            //    .ForEach(t => builder.RegisterType(t).AsImplementedInterfaces());

            //ViewModels
            Assembly.GetCallingAssembly().ExportedTypes
            .Where(t => t.IsClass && !t.IsInterface && !t.IsAbstract && typeof(ViewModelBase).IsAssignableFrom(t))
            .ForEach(t => builder.RegisterType(MvvmHelper.CreateViewModelProxyType(t)).As(t));
        }