Example #1
0
        /// <summary>
        /// Creates an instance of the <see cref="CustomMasterDetailContainer"/> containing all pages for this session.
        /// </summary>
        /// <returns></returns>
        private CustomMasterDetailContainer CreateMasterDetailContainerInstance()
        {
            var masterDetailNav = new CustomMasterDetailContainer();

            masterDetailNav.Init("App2Night");
            masterDetailNav.AddPage <DashboardPageModel>(AppResources.Dashboard, "\uf015");
            masterDetailNav.AddPage <PartyPickerViewModel>(AppResources.PickAParty, "\uf29b");
            masterDetailNav.AddPage <CreatePartyViewModel>(AppResources.CreateAParty, "\uf271", requiresLogin: true);
            masterDetailNav.AddPage <MyPartysViewModel>(AppResources.MyParties, "\uf274", requiresLogin: true);
            masterDetailNav.AddPage <SettingViewModel>(AppResources.Settings, "\uf085");
            masterDetailNav.AddPage <AboutTabbedViewModel>(AppResources.About, "\uf05a");
            return(masterDetailNav);
        }
Example #2
0
        public App()
        {
            MobileCenter.Start(typeof(Analytics), typeof(Crashes));

            SetupGeolocator();
            CheckIfMapsIsAvailable();

            InitializeComponent();

            RegisterInterfaces();

            _masterDetailNav = CreateMasterDetailContainerInstance();

            MainPage = _masterDetailNav;

            if (Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android)
            {
                var ci = Xamarin.Forms.DependencyService.Get <ICultureService>().GetCurrentCultureInfo();
                AppResources.Culture = ci;                                             // set the RESX for resource localization
                Xamarin.Forms.DependencyService.Get <ICultureService>().SetLocale(ci); // set the Thread for locale-aware methods
            }
        }