private static void RegisterServices(NavigationServiceEx nav) { var builder = new ContainerBuilder(); builder.RegisterInstance(nav) .AsImplementedInterfaces() .AsSelf(); builder.RegisterModule <WindowsModule>(); ViewModelLocator.RegisterServices(builder); }
private async Task InitializeAsync(object activationArgs) { ExecutingPlatform.Current = AppPlatform.UWP; LoggerService.Initialize(); ConfigurationManager.Initialise(PortableStream.Current); ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0]; #if !DEBUG AppCenter.Start(ConfigurationManager.AppSettings["WindowsAppcenterSecret"], typeof(Analytics), typeof(Crashes)); #endif NavigationServiceEx navService = ConfigureNavigation(); RegisterServices(navService); Forms.Init(activationArgs as LaunchActivatedEventArgs); new Presentation.App(); BackgroundTaskService.RegisterBackgroundTasks(); ThemeSelectorService.Initialize(app.RequestedTheme); await JumpListService.InitializeAsync(); }
public NavigationServiceEx ConfigureNavigation() { var nav = new NavigationServiceEx(); nav.Configure(ViewModelLocator.AccountList, typeof(AccountListView)); nav.Configure(ViewModelLocator.PaymentList, typeof(PaymentListView)); nav.Configure(ViewModelLocator.CategoryList, typeof(CategoryListView)); nav.Configure(ViewModelLocator.SelectCategoryList, typeof(SelectCategoryListView)); nav.Configure(ViewModelLocator.AddAccount, typeof(AddAccountView)); nav.Configure(ViewModelLocator.AddCategory, typeof(AddCategoryView)); nav.Configure(ViewModelLocator.AddPayment, typeof(AddPaymentView)); nav.Configure(ViewModelLocator.EditAccount, typeof(EditAccountView)); nav.Configure(ViewModelLocator.EditCategory, typeof(EditCategoryView)); nav.Configure(ViewModelLocator.EditPayment, typeof(EditPaymentView)); nav.Configure(ViewModelLocator.Settings, typeof(SettingsView)); nav.Configure(ViewModelLocator.StatisticSelector, typeof(StatisticSelectorView)); nav.Configure(ViewModelLocator.StatisticCashFlow, typeof(StatisticCashFlowView)); nav.Configure(ViewModelLocator.StatisticCategorySpreading, typeof(StatisticCategorySpreadingView)); nav.Configure(ViewModelLocator.StatisticCategorySummary, typeof(StatisticCategorySummaryView)); nav.Configure(ViewModelLocator.Backup, typeof(BackupView)); return(nav); }