Пример #1
0
        public App()
        {
            DomainExceptionHandler.HandleDomainExceptions();
            ConfigureIoC();
            ViewForAttribute.ProceedRelatedAssemblies();

            ConfigureInformers();
            ConfigureManipulatorContexts();

            //TODO: Line 45: Configurator.Configure(Manipulators, Service, InformersManager);
            //TODO: Line 46: Configurator.Web(Http, Logger);
        }
        /// <inheritdoc cref="DataTemplateSelector.SelectTemplate"/>
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item == null)
            {
                return(base.SelectTemplate(null, container));
            }

            var dataType = item.GetType();
            var viewType = ViewForAttribute.GetBestMatchingViewType(dataType);

            if (viewType != null)
            {
                return(CreateDataTemplate(dataType, viewType, item));
            }

            return(base.SelectTemplate(item, container));
        }
Пример #3
0
        /// <inheritdoc />
        public App()
        {
            //Navigation.Dispatcher = Dispatcher;
            //Navigation.SetShellResolver(new SingleThreadShellResolver());
            //Note: this sample also provides useful MultiThreadShellResolver which will put all windows
            // into separate dispatchers (and threads) except child windows and dialogs.S
            Navigation.SetShellResolver(new MultiThreadShellResolver());

            //TODO: Load all assemblies which can contain navigation configs
            //For example, you use this example to load assemblies dynamicall
            AppDomain.CurrentDomain.LoadAssemblies("Sample_1.Modules.*.dll");
            AppDomain.CurrentDomain.InitializeTypesFromAttribute().Wait();

            Navigation.AllWindowsClosed += NavigationOnAllWindowsClosed;
            Navigation.NavigationFailed += NavigationOnNavigationFailed;

            //React when view or config dynamically are loaded dynamically after all have been proeceeded.
            AppDomain.CurrentDomain.AssemblyLoad += CurrentDomainOnAssemblyLoad;
            //Proceed all configs
            Navigation.RegisterAvailableConfigs(ConfigResolver);
            //Proceed all views
            ViewForAttribute.ProceedRelatedAssemblies();
        }
Пример #4
0
 private void CurrentDomainOnAssemblyLoad(object sender, AssemblyLoadEventArgs args)
 {
     ViewForAttribute.ProceedAssembly(args.LoadedAssembly);
     Navigation.RegisterAvailableConfigs(args.LoadedAssembly, ConfigResolver);
 }