Beispiel #1
0
        public App()
        {
            var sqlConnection = DependencyService.Get <ISqLiteService> ().GetConnection();

            Settings = new Settings(sqlConnection);

            var mePage = new MePage {
                BindingContext = new MeViewModel(),
                Title          = "Me"
            };
            var meNavigationPage = new NavigationPage(mePage)
            {
                Title = "Me",
                Icon  = "icon_user.png"
            };

            var settingsPage = new SettingsPage {
                Title = "Settings"
            };
            var navigationSettingsPage = new NavigationPage(settingsPage)
            {
                Title = "Settings",
                Icon  = "icon_settings.png"
            };

            Navigation = navigationSettingsPage.Navigation;

            settingsPage.BindingContext = new SettingsViewModel();

            var mainPage = new TabbedPage();

            mainPage.Children.Add(meNavigationPage);
            mainPage.Children.Add(navigationSettingsPage);

            MainPage = mainPage;

            BeaconService       = DependencyService.Get <IBeaconService> ();
            NotificationService = DependencyService.Get <INotificationService> ();
            EncounterUtils      = new BeaconEventsUtils(sqlConnection, NotificationService);
        }
Beispiel #2
0
		public App ()
		{
			var sqlConnection = DependencyService.Get<ISqLiteService> ().GetConnection ();

			Settings = new Settings (sqlConnection);

			var mePage = new MePage {
				BindingContext = new MeViewModel (),
				Title = "Me"
			};
			var meNavigationPage = new NavigationPage (mePage) {
				Title = "Me",
				Icon = "icon_user.png"
			};

			var settingsPage = new SettingsPage {
				Title = "Settings"
			};
			var navigationSettingsPage = new NavigationPage (settingsPage) {
				Title = "Settings",
				Icon = "icon_settings.png"
			};
			Navigation = navigationSettingsPage.Navigation;

			settingsPage.BindingContext = new SettingsViewModel ();

			var mainPage = new TabbedPage ();
			mainPage.Children.Add (meNavigationPage);
			mainPage.Children.Add (navigationSettingsPage);

			MainPage = mainPage;

			BeaconService = DependencyService.Get<IBeaconService> ();
			NotificationService = DependencyService.Get<INotificationService> ();
			EncounterUtils = new BeaconEventsUtils (sqlConnection, NotificationService);
		}