예제 #1
0
        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);
            }
        }
예제 #2
0
 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>());
 }
예제 #3
0
        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);
 }
예제 #5
0
 public void Initialize()
 {
     _fakeService = new Mock <DependencyResolverService>().Object;
 }
예제 #6
0
 protected override void AppStartup(StartupEventArgs e, IDependencyResolverService resolver)
 {
     resolver.ResolveView <MainWindow, MainViewModel>().Show();
 }
예제 #7
0
 protected override void AppExit(ExitEventArgs e, IDependencyResolverService resolver)
 {
 }
예제 #8
0
 protected override void AppExit(ExitEventArgs e, IDependencyResolverService resolver)
 {
     resolver.RemoveUnhandledExceptionHandler();
 }
예제 #9
0
 public DependencyResolverController(IDependencyResolverService dependencyResolverService)
 {
     _dependencyResolverService = dependencyResolverService;
 }
예제 #10
0
 protected abstract void AppExit(ExitEventArgs e, IDependencyResolverService resolver);
예제 #11
0
 protected abstract void AppStartup(StartupEventArgs e, IDependencyResolverService resolver);