Beispiel #1
0
        public App(ISettingsService settingsService, INotificationHubsService notificationHubsService)
        {
            this.InitIoC();

            if (!IoC.GetContainer.IsRegistered <ISettingsService>())
            {
                IoC.GetContainer.Register(() => settingsService);
            }

            if (!IoC.GetContainer.IsRegistered <INotificationHubsService>())
            {
                IoC.GetContainer.Register(() => notificationHubsService);
            }


            var ss = IoC.IoCGet <ISettingsService>();
            var nh = IoC.IoCGet <INotificationHubsService>();

            List <string> tags = new List <string>()
            {
                "TestTag",
                "RobinTest",
                "QWERTY"
            };

            ss.Tags = tags;
            nh.RegisterOrUpdate();

            this.SetNextPage <HomePage>(new TestModelData());
        }
Beispiel #2
0
        public App(ISettingsService settingsService, INotificationHubsService notificationHubsService)
        {
            InitializeComponent();

            SimpleIoc.Default.Register <ISettingsService>(() => settingsService);
            SimpleIoc.Default.Register <INotificationHubsService>(() => notificationHubsService);

            // define the navigation
            var nav = new NavigationService();

            SimpleIoc.Default.Register <INavigationService>(() => nav);

            // define the dialog service
            var dialog = new DialogService();

            SimpleIoc.Default.Register <IDialogService>(() => dialog);

            var navPage = new NavigationPage(new MainPage());

            // init services
            nav.Initialize(navPage);
            dialog.Initialize(navPage);

            MainPage = navPage;
        }