コード例 #1
0
        protected override void DetailSet(MvvmNanoMasterDetailData lastDetailData, MvvmNanoMasterDetailData newDetailData, Page page)
        {
            base.DetailSet(lastDetailData, newDetailData, page);
            MvvmNanoNavigationPage navi = (MvvmNanoNavigationPage)page.Parent;

            navi.BarBackgroundColor = (Xamarin.Forms.Color)Application.Current.Resources["MainColor"];
        }
コード例 #2
0
        /// <summary>
        /// Set the Detail, hide the menu and make sure, that the correct menu entry is selected.
        /// </summary>
        /// <param name="page">The new detail.</param>
        /// <param name="pageData">The detail data associated with the new page, provide if already known. Will get resolved otherwise.</param>
        internal void SetDetail(Page page, MvvmNanoMasterDetailData pageData = null)
        {
            var oldDetailData = _currentDetailData;

            //Resolve the page data if it is not given
            if (pageData == null)
            {
                pageData = MasterDetails.FirstOrDefault(
                    x => ViewViewModelHelper.ViewNameFromViewModel(x.ViewModelType) == page.GetType().Name);

                if (pageData == null)
                {
                    throw new MvvmNanoException($"There is no detail registered for the page ${page.GetType().Name}.");
                }
            }

            _currentDetailData = pageData;

            //Set the title if the page does not have one
            if (string.IsNullOrEmpty(page.Title))
            {
                page.Title = pageData.Title;
            }

            //Show the page if it is not already presented
            if (_detail != page)
            {
                _detail     = page;
                Detail      = new MvvmNanoNavigationPage(page);
                IsPresented = false;
            }

            DetailSet(oldDetailData, pageData, page);
        }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: krdmllr/WorkTimer
        protected override void OnStart()
        {
            base.OnStart();

            SetUpDependencies();

            MainPage = new MvvmNanoNavigationPage(GetTabbedPageFor <MainTabbedViewModel>());

            Task.Run(async() => await Setup());
        }
コード例 #4
0
ファイル: App.cs プロジェクト: iamvignesh/MvvmNano
        private void SetUpMainPage()
        {
            var viewModel = MvvmNanoIoC.Resolve <LoginViewModel>();

            viewModel.Initialize();

            var page = new LoginPage();

            page.SetViewModel(viewModel);

            MainPage = new MvvmNanoNavigationPage(page);
        }