当前位置: 首页>>代码示例>>C#>>正文


C# IViewModelFactory类代码示例

本文整理汇总了C#中IViewModelFactory的典型用法代码示例。如果您正苦于以下问题:C# IViewModelFactory类的具体用法?C# IViewModelFactory怎么用?C# IViewModelFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IViewModelFactory类属于命名空间,在下文中一共展示了IViewModelFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OutlookMailSender

 public OutlookMailSender(IViewModelFactory vmf, ITempFileService tmpService)
 {
     if (vmf == null) throw new ArgumentNullException("vmf");
     if (tmpService == null) throw new ArgumentNullException("tmpService");
     _vmf = vmf;
     _tmpService = tmpService;
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:OutlookMailSender.cs

示例2: NavigationService

		public NavigationService(
			Frame frame,
			IPageDefinitionRegistry pageDefinitions,
			IViewModelFactory viewModelFactory,
			IScheduler dispatcherScheduler,
			IScheduler backgroundScheduler)
		{
			if (frame == null) throw new ArgumentNullException("frame");
			if (pageDefinitions == null) throw new ArgumentNullException("pageDefinitions");
			if (viewModelFactory == null) throw new ArgumentNullException("viewModelFactory");
			if (dispatcherScheduler == null) throw new ArgumentNullException("dispatcherScheduler");
			if (backgroundScheduler == null) throw new ArgumentNullException("backgroundScheduler");
			_frame = frame;
			_pageDefinitions = pageDefinitions;
			_viewModelFactory = viewModelFactory;
			_dispatcherScheduler = dispatcherScheduler;
			_backgroundScheduler = backgroundScheduler;
			_navigatingSubject = new Subject<INavigationRequest>();
			_navigatedSubject = new Subject<INavigationRequest>();
			_semaphore = new SemaphoreSlim(1);
			History = _history = new NavigationHistory(RemoveHistoryEntry, ClearHistory);

			_frame.Navigated += _frame_Navigated;
			//_frame.BackKeyPress += _frame_BackKeyPress;
		}
开发者ID:Galad,项目名称:Hanno,代码行数:25,代码来源:NavigationService.cs

示例3: DialogCreator

 public DialogCreator(IZetboxContext ctx, IViewModelFactory mdlFactory, IFrozenContext frozenCtx)
 {
     ValueModels = new List<BaseValueViewModel>();
     DataContext = ctx;
     ViewModelFactory = mdlFactory;
     FrozenCtx = frozenCtx;
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:DialogCreator.cs

示例4: ChildWindowViewModel

        public ChildWindowViewModel(IViewModelFactory viewModelFactory)
        {
            _viewModelFactory = viewModelFactory;

            Messenger.Default.Register<DisplayErrorSavingDataMessage>(this, HandleMessage);
            Messenger.Default.Register<DisplayErrorRetrievingDataMessage>(this, HandleMessage);
        }
开发者ID:stuartleyland,项目名称:PresentBinder,代码行数:7,代码来源:ChildWindowViewModel.cs

示例5: Initialize

 public static void Initialize()
 {
     var kernel = new StandardKernel(new RegistrationModule());
     kernel.Load("DD4T.ContentModel.Contracts");
     kernel.Load("DD4T.Factories");
     kernel.Load("DD4T.Providers.Test");
     kernel.Load("DD4T.ViewModels");
     PageFactory = kernel.Get<IPageFactory>();
     ComponentPresentationFactory = kernel.Get<IComponentPresentationFactory>();
     ComponentFactory = kernel.Get<IComponentFactory>();
     PageFactory.CacheAgent = kernel.Get<ICacheAgent>();
     PageFactory.PageProvider = kernel.Get<IPageProvider>();
     ComponentPresentationFactory.CacheAgent = kernel.Get<ICacheAgent>();
     ComponentPresentationFactory.ComponentPresentationProvider = kernel.Get<IComponentPresentationProvider>();
     ((ComponentFactory)ComponentFactory).ComponentPresentationFactory = ComponentPresentationFactory;
     ((TridionPageProvider)PageFactory.PageProvider).SerializerService = kernel.Get<ISerializerService>();
     ((TridionComponentPresentationProvider)ComponentPresentationFactory.ComponentPresentationProvider).SerializerService = kernel.Get<ISerializerService>();
     ((TridionPageProvider)PageFactory.PageProvider).ComponentPresentationProvider = ComponentPresentationFactory.ComponentPresentationProvider;
     kernel.Bind<IViewModelKeyProvider>().To <WebConfigViewModelKeyProvider>();
     kernel.Bind<IViewModelResolver>().To<DefaultViewModelResolver>();
     kernel.Bind<IViewModelFactory>().To<ViewModelFactory>();
     kernel.Bind<IReflectionHelper>().To<ReflectionOptimizer>();
     ViewModelFactory = kernel.Get<IViewModelFactory>();
     ViewModelFactory.LoadViewModels(new [] { typeof(TestViewModelA).Assembly });
 }
开发者ID:contacttomukesh,项目名称:DD4T.Core,代码行数:25,代码来源:BaseFactoryTest.cs

示例6: UnhandledErrorViewModel

 public UnhandledErrorViewModel(
     IViewModelManager viewModelManager, 
     IViewModelFactory viewModelFactory,
     IReactiveCommandFactory reactiveCommandFactory)
     : base(viewModelManager, viewModelFactory, reactiveCommandFactory)
 {
 }
开发者ID:Dki56t,项目名称:MyNot,代码行数:7,代码来源:UnhandledErrorViewModel.cs

示例7: ApplicationViewModel

        public ApplicationViewModel(INavigationService viewNavigationService, IUserService userService, IViewModelFactory viewModelFactory)
        {
            ObjectValidator.IfNullThrowException(viewNavigationService, "viewNavigationService");
            ObjectValidator.IfNullThrowException(userService,  "userService");
            ObjectValidator.IfNullThrowException(viewModelFactory, "viewModelFactory");

            this.viewModelFactory = viewModelFactory;
            this.ViewNavigationService = viewNavigationService;

            this.Back = new RelayCommand(o => this._GoBack(), o => true);
            this.Forward = new RelayCommand(o => this._GoForward(), o => true);
            this.Close = new RelayCommand(o => this._Close(), o => true);

            this.LeftNavigationButtonCollection = new List<DisplayableNavigationCommand>();

            /*All this behaviour needs to be moved to a loaded command*/
            this.ViewNavigationService.CurrentPage = viewModelFactory.Get<StartPageViewModel>();
            ViewNavigationService.GetDefaultPagesByNames().Each(page => this.LeftNavigationButtonCollection.Add(
                                                                    new DisplayableNavigationCommand(
                                                                     page.Key,
                                                                     async () => await TaskEx.Run(() => ViewNavigationService.CurrentPage = page.Value()),
                                                                     () => true)));

            ViewNavigationService.PageChanged += async (sender, args) =>
            {
                if ((ViewNavigationService.CurrentPage as ProjectDashBoardViewModel) != null)
                {
                    await this._LoadNonDefaultPages();
                }
            };
        }
开发者ID:joomnet,项目名称:SkillSignal,代码行数:31,代码来源:ApplicationViewModel.cs

示例8: WrappingViewModel

 public WrappingViewModel(
     IViewModelManager viewModelManager, 
     IViewModelFactory viewModelFactory,
     IReactiveCommandFactory reactiveCommandFactory)
     : base(viewModelManager, viewModelFactory, reactiveCommandFactory)
 {
 }
开发者ID:Dki56t,项目名称:MyNot,代码行数:7,代码来源:WrappingViewModel.cs

示例9: NotificationService

        public NotificationService(IViewModelFactory viewModelFactory, IDispatcherService dispatcherService,
            INotificationPositionService notificationPositionService)
        {
            Argument.IsNotNull(() => viewModelFactory);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => notificationPositionService);

            _viewModelFactory = viewModelFactory;
            _dispatcherService = dispatcherService;
            _notificationPositionService = notificationPositionService;

            CurrentNotifications = new ObservableCollection<INotification>();

            DefaultBorderBrush = Brushes.Black;
            DefaultBackgroundBrush = Brushes.DodgerBlue;
            DefaultFontBrush = Brushes.WhiteSmoke;

            var app = Application.Current;
            if (app != null)
            {
                var accentColorBrush = app.TryFindResource("AccentColorBrush") as SolidColorBrush;
                if (accentColorBrush != null)
                {
                    DefaultBorderBrush = accentColorBrush;
                    DefaultBackgroundBrush = new SolidColorBrush(Color.FromArgb(255, 245, 245, 245));
                    DefaultFontBrush = Brushes.Black;
                    accentColorBrush.Color.CreateAccentColorResourceDictionary();
                }

                _mainWindow = app.MainWindow;
            }
        }
开发者ID:punker76,项目名称:Orc.Notifications,代码行数:32,代码来源:NotificationService.cs

示例10: Launcher

 public Launcher(Func<ContextIsolationLevel, IZetboxContext> ctxFactory, IViewModelFactory mdlFactory, IFrozenContext frozenCtx, ZetboxConfig cfg, IPerfCounter perfCounter)
 {
     this.frozenCtx = frozenCtx;
     this.ctxFactory = ctxFactory;
     this.mdlFactory = mdlFactory;
     this.cfg = cfg;
     this.perfCounter = perfCounter;
 }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:Launcher.cs

示例11: ReportingErrorDialog

        public ReportingErrorDialog(IViewModelFactory vmFactory, Lazy<IZetboxContext> lazyCtx)
        {
            if (vmFactory == null) throw new ArgumentNullException("vmFactory");
            if (lazyCtx == null) throw new ArgumentNullException("lazyCtx");

            _viewModelFactory = vmFactory;
            _lazyCtx = lazyCtx;
        }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:ReportingErrorDialog.cs

示例12: ZetboxContextExceptionHandler

        public ZetboxContextExceptionHandler(IViewModelFactory vmf, IFrozenContext frozenCtx)
        {
            if (vmf == null) throw new ArgumentNullException("vmf");
            if (frozenCtx == null) throw new ArgumentNullException("frozenCtx");

            this.vmf = vmf;
            this.frozenCtx = frozenCtx;
        }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:ZetboxContextExceptionHandler.cs

示例13: ViewModelDependencies

 public ViewModelDependencies(IViewModelFactory f, IUiThreadManager ui, IAsyncThreadManager async, IFrozenContext frozenCtx, IIdentityResolver idResolver)
 {
     Factory = f;
     UiThread = ui;
     AsyncThread = async;
     FrozenContext = frozenCtx;
     IdentityResolver = idResolver;
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:8,代码来源:ClientModule.cs

示例14: WordRibbonFactory

 /// <summary>
 /// Initializes a new instance of the <see cref="WordRibbonFactory"/> class.
 /// </summary>
 /// <param name="viewModelFactory">A view model factory</param>
 /// <param name="customTaskPaneCollection">A delayed resolution instance of the custom task pane collection of your addin 'new Lazy(()=>CustomTaskPaneCollection)'</param>
 /// <param name="vstoFactory">The VSTO factory (Globals.Factory)</param>
 /// <param name="assemblies">Assemblies to scan for view models</param>
 public WordRibbonFactory(
     IViewModelFactory viewModelFactory,
     Func<object> customTaskPaneCollection, 
     Factory vstoFactory, 
     params Assembly[] assemblies)
     : base(new RibbonFactoryController<WordRibbonType>(assemblies, new WordViewContextProvider(), viewModelFactory, customTaskPaneCollection, vstoFactory))
 {
 }
开发者ID:roxberry,项目名称:VSTOContrib,代码行数:15,代码来源:WordRibbonFactory.cs

示例15: MonitoringInstancesViewModelFactory

		public MonitoringInstancesViewModelFactory(IViewModelFactory innerViewModelFactory, TimeSpan time)
		{
			if (innerViewModelFactory == null) throw new ArgumentNullException("innerViewModelFactory");
			_innerViewModelFactory = innerViewModelFactory;

			_instanceMonitor = InstanceTracker.MonitorByType<IViewModel>(time);
			_instanceMonitor.Update += _instanceMonitor_Update;
		}
开发者ID:Galad,项目名称:Hanno,代码行数:8,代码来源:MonitoringInstancesViewModelFactory.cs


注:本文中的IViewModelFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。