//LoginViewModel loginViewModel; public HomeViewPage(LoginViewModel loginViewModel) { pages = new Dictionary <MenuType, iiNavigationPage>(); BindingContext = new HomeViewModel(); ViewModel.LogViewModel = loginViewModel; Master = _master = new HomeMasterPage(ViewModel); var homeNav = new iiNavigationPage(_master.PageSelection) { // BackgroundColor = Helper.Color.Pink.ToFormsColor(), // BarTextColor = Helper.Color.White.ToFormsColor(), //BarBackgroundColor= Helper.Color.iiGreen.ToFormsColor() }; Detail = homeNav; pages.Add(MenuType.Dashboard, homeNav); _master.PageSelectionChanged = async(menuType) => { if (Detail != null && Device.OS == TargetPlatform.WinPhone) { await Detail.Navigation.PopToRootAsync(); } iiNavigationPage newPage; if (pages.ContainsKey(menuType)) { newPage = pages[menuType]; } else { newPage = new iiNavigationPage(_master.PageSelection) { // BarBackgroundColor = Helper.Color.iiPurple.ToFormsColor(), //BarTextColor = Xamarin.Forms.Color.White //GO inside iiNavigaton Constructor }; pages.Add(menuType, newPage); } Detail = newPage; Detail.Title = _master.PageSelection.Title; IsPresented = false; }; this.Icon = "slideout.png"; }
//LoginViewModel loginViewModel; public HomeViewPage(LoginViewModel loginViewModel) { pages = new Dictionary<MenuType, iiNavigationPage>(); BindingContext = new HomeViewModel(); ViewModel.LogViewModel = loginViewModel; Master = _master = new HomeMasterPage(ViewModel); var homeNav = new iiNavigationPage(_master.PageSelection) { // BackgroundColor = Helper.Color.Pink.ToFormsColor(), // BarTextColor = Helper.Color.White.ToFormsColor(), //BarBackgroundColor= Helper.Color.iiGreen.ToFormsColor() }; Detail = homeNav; pages.Add(MenuType.Dashboard, homeNav); _master.PageSelectionChanged = async (menuType) => { if (Detail != null && Device.OS == TargetPlatform.WinPhone) { await Detail.Navigation.PopToRootAsync(); } iiNavigationPage newPage; if (pages.ContainsKey(menuType)) { newPage = pages[menuType]; } else { newPage = new iiNavigationPage(_master.PageSelection) { // BarBackgroundColor = Helper.Color.iiPurple.ToFormsColor(), //BarTextColor = Xamarin.Forms.Color.White //GO inside iiNavigaton Constructor }; pages.Add(menuType, newPage); } Detail = newPage; Detail.Title = _master.PageSelection.Title; IsPresented = false; }; this.Icon = "slideout.png"; }