protected override void AppStartup(StartupEventArgs e, IDependencyResolverService resolver) { resolver.UseUnhandledExceptionHandler(); resolver.ResolveView <MainWindow, MainWindowViewModel>().Show(); if (e.Args.Any()) { resolver.Resolve <AppLogger>().Info(string.Join('\n', e.Args)); resolver.Resolve <IFileLoader>().Load(e.Args); } }
public DialogManager(IDependencyResolverService service) { ObjDetails = new ProxyDialog <ObjDetailsWindow, ObjDetailsViewModel>( () => service.ResolveView <ObjDetailsWindow, ObjDetailsViewModel>()); OpenFiles = new ProxyDialog <OpenFilesWindow, OpenFilesViewModel>( () => service.ResolveView <OpenFilesWindow, OpenFilesViewModel>()); SaveAll = new ProxyDialog <SaveAllWindow, SaveAllViewModel>( () => service.ResolveView <SaveAllWindow, SaveAllViewModel>()); Plugins = new ProxyDialog <PluginsWindow, PluginsViewModel>( () => service.ResolveView <PluginsWindow, PluginsViewModel>()); }
public static TView ResolveView <TView, TViewModel>(this IDependencyResolverService container) where TView : FrameworkElement where TViewModel : BaseNotify { var view = container.Resolve <TView>(); var vm = container.Resolve <TViewModel>(); view.DataContext = vm; view.Loaded += (x, y) => vm.OnLoaded(); view.Unloaded += (x, y) => vm.OnUnloaded(); return(view); }
public static IDependencyResolverService RemoveUnhandledExceptionHandler(this IDependencyResolverService service) { service.Resolve <UnhandledExceptionHandler>().StopHandling(); return(service); }
public void Initialize() { _fakeService = new Mock <DependencyResolverService>().Object; }
protected override void AppStartup(StartupEventArgs e, IDependencyResolverService resolver) { resolver.ResolveView <MainWindow, MainViewModel>().Show(); }
protected override void AppExit(ExitEventArgs e, IDependencyResolverService resolver) { }
protected override void AppExit(ExitEventArgs e, IDependencyResolverService resolver) { resolver.RemoveUnhandledExceptionHandler(); }
public DependencyResolverController(IDependencyResolverService dependencyResolverService) { _dependencyResolverService = dependencyResolverService; }
protected abstract void AppExit(ExitEventArgs e, IDependencyResolverService resolver);
protected abstract void AppStartup(StartupEventArgs e, IDependencyResolverService resolver);