Exemple #1
0
		public LoginPageView()
		{
			BindingContext = new LoginViewModel(this.Navigation);
			BackgroundImage = "back.png";
            Content = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                Children =
                {      
                    CreateStackfor(),
                }
            };
		}
        public DashboardViewPage(LoginViewModel loginViewModel)
        {
            BindingContext = loginViewModel.EmpViewModel.EmployeeInfo;
         
            GenerateView();
            var logOut = new ToolbarItem
            {
                Command = loginViewModel.LogoutCommand,
                Icon = "logout.png",
                Priority = 0,
            };

           // if (!ViewModel.LogViewModel.EmpViewModel.EmployeeInfo.IsAdmin)
                ToolbarItems.Add(logOut);
            //ViewModel.LogViewModel = loginViewModel;
        }
Exemple #3
0
        //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";
        }