protected override MvvmCross.Core.Views.IMvxViewDispatcher CreateViewDispatcher() { var dispatcher = base.CreateViewDispatcher(); Mvx.RegisterSingleton <IMvxNavigationService>(() => new MvxNavigationService(dispatcher)); MvxNavigationService.LoadRoutes(GetViewModelAssemblies()); return(dispatcher); }
protected virtual IMvxNavigationService InitializeNavigationService(IMvxViewDispatcher dispatcher) { var navigationService = new MvxNavigationService(dispatcher); Mvx.RegisterSingleton <IMvxNavigationService>(navigationService); MvxNavigationService.LoadRoutes(GetViewModelAssemblies()); return(navigationService); }
public RoutingServiceTests(MvxTestFixture fixture) { _fixture = fixture; _fixture.ClearAll(); MvxNavigationService.LoadRoutes(new[] { typeof(RoutingServiceTests).Assembly }); // ReSharper disable once AssignNullToNotNullAttribute Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); AdditionalSetup(fixture); }
protected override void AdditionalSetup() { base.AdditionalSetup(); // for navigation parsing Ioc.RegisterSingleton <IMvxStringToTypeParser>(new MvxStringToTypeParser()); // for navigation MvxNavigationService navigationService = new MvxNavigationService(null, null) { ViewDispatcher = MockDispatcher, } ; navigationService.LoadRoutes(new[] { typeof(WPF.UI.ViewModels.ClassManagementViewModel).Assembly }); Ioc.RegisterSingleton <IMvxNavigationService>(navigationService); // for commands var commandHelper = new MvxUnitTestCommandHelper(); Ioc.RegisterSingleton <IMvxCommandHelper>(commandHelper); // for theme var themeService = new WPF.UI.Services.ThemeService(); Ioc.RegisterSingleton <WPF.UI.Services.IThemeService>(themeService); // for permission var userPermissions = new UserPermissions(); Ioc.RegisterSingleton <IUserPermissions>(userPermissions); // for ldap var ldapService = new LdapService(); Ioc.RegisterSingleton <ILdapService>(ldapService); }
protected virtual void LoadNavigationServiceRoutes() { MvxNavigationService.LoadRoutes(GetViewModelAssemblies()); }
public static void SetupFixture() { MvxNavigationService.LoadRoutes(new[] { typeof(RoutingServiceTests).Assembly }); }