Beispiel #1
0
        private static void RegisterAllServices()
        {
            SimpleIoC.RegisterSingleton <IPageCachingService, PageCachingService>();
            SimpleIoC.RegisterSingleton <INavigationService, NavigationService>();
            var client = new HttpClient();

            SimpleIoC.RegisterInstance <IWebService>(new WebService(client));
        }
Beispiel #2
0
        private static void RegisterAllViewModels()
        {
            Assembly currentAssembly = typeof(App).GetTypeInfo().Assembly;

            var viewModelTypes = currentAssembly.ExportedTypes.Where(t => t.Name.EndsWith("ViewModel"));

            foreach (var type in viewModelTypes)
            {
                if (!type.GetTypeInfo().IsAbstract)
                {
                    SimpleIoC.RegisterSingleton(type);
                }
            }
        }