本文整理汇总了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;
}
示例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;
}
示例3: DialogCreator
public DialogCreator(IZetboxContext ctx, IViewModelFactory mdlFactory, IFrozenContext frozenCtx)
{
ValueModels = new List<BaseValueViewModel>();
DataContext = ctx;
ViewModelFactory = mdlFactory;
FrozenCtx = frozenCtx;
}
示例4: ChildWindowViewModel
public ChildWindowViewModel(IViewModelFactory viewModelFactory)
{
_viewModelFactory = viewModelFactory;
Messenger.Default.Register<DisplayErrorSavingDataMessage>(this, HandleMessage);
Messenger.Default.Register<DisplayErrorRetrievingDataMessage>(this, HandleMessage);
}
示例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 });
}
示例6: UnhandledErrorViewModel
public UnhandledErrorViewModel(
IViewModelManager viewModelManager,
IViewModelFactory viewModelFactory,
IReactiveCommandFactory reactiveCommandFactory)
: base(viewModelManager, viewModelFactory, reactiveCommandFactory)
{
}
示例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();
}
};
}
示例8: WrappingViewModel
public WrappingViewModel(
IViewModelManager viewModelManager,
IViewModelFactory viewModelFactory,
IReactiveCommandFactory reactiveCommandFactory)
: base(viewModelManager, viewModelFactory, reactiveCommandFactory)
{
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例13: ViewModelDependencies
public ViewModelDependencies(IViewModelFactory f, IUiThreadManager ui, IAsyncThreadManager async, IFrozenContext frozenCtx, IIdentityResolver idResolver)
{
Factory = f;
UiThread = ui;
AsyncThread = async;
FrozenContext = frozenCtx;
IdentityResolver = idResolver;
}
示例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))
{
}
示例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;
}