Example #1
0
        void Handle_ItemTapped(object sender, Xamarin.Forms.ItemTappedEventArgs e)
        {
            var listView = (ListView)sender;

            var selectedLVWPAST = (UserJustWithPicAndName)listView.SelectedItem;

            if (GlobalVariables.ActualUsersEmail != selectedLVWPAST.Email)
            {
                var searchResultPage = new SeeAnOwnerPage(selectedLVWPAST.id);

                Navigation.PushAsync(searchResultPage);
            }
            else
            {
                var searchResultPage = new MyAccountPage();

                Navigation.PushAsync(searchResultPage);
            }
        }
        public MainPage()
        {
            InitializeComponent();

            CrossConnectivity.Current.ConnectivityChanged += async(sender, args) =>
            {
                if (!CrossConnectivity.Current.IsConnected && !wasNotConn)
                {
                    wasNotConn = true;

                    await Navigation.PushModalAsync(new NoConnection());
                }
                else
                {
                    wasNotConn = false;
                }
            };

            NavigationPage.SetHasBackButton(this, false);
            NavigationPage.SetHasNavigationBar(this, false);

            Device.BeginInvokeOnMainThread(() =>
            {
                var homePage = new HomePage();

                var navigationHomePage = new NavigationPage(homePage);
                //navigationHomePage.Title = "Főmenü";
                navigationHomePage.Icon  = GlobalVariables.homepng;
                navigationHomePage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(homePage, false);

                var searchPage           = new SearchPage();
                var navigationSearchPage = new NavigationPage(searchPage);
                //navigationSearchPage.Title = "Keresés";
                navigationSearchPage.Icon  = GlobalVariables.searchpng;
                navigationSearchPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(searchPage, false);

                var peopleSearchPage           = new PeopleSearchPage();
                var navigationPeopleSearchPage = new NavigationPage(peopleSearchPage);
                //navigationMyAccountPage.Title = "Fiók";
                navigationPeopleSearchPage.Icon  = GlobalVariables.peoplepng;
                navigationPeopleSearchPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(peopleSearchPage, false);

                var uploadPhotoPage           = new UploadPhotoPage();
                var navigationUploadPhotoPage = new NavigationPage(uploadPhotoPage);
                //navigationUploadPhotoPage.Title = "Fotó";
                navigationUploadPhotoPage.Icon  = GlobalVariables.camerapng;
                navigationUploadPhotoPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(uploadPhotoPage, false);

                var myAccountPage           = new MyAccountPage();
                var navigationMyAccountPage = new NavigationPage(myAccountPage);
                //navigationMyAccountPage.Title = "Fiók";
                navigationMyAccountPage.Icon  = GlobalVariables.profilepng;
                navigationMyAccountPage.Style = GlobalVariables.NavigationPageStyle;
                NavigationPage.SetHasNavigationBar(myAccountPage, false);

                Children.Add(navigationHomePage);
                Children.Add(navigationSearchPage);
                Children.Add(navigationPeopleSearchPage);
                Children.Add(navigationUploadPhotoPage);
                Children.Add(navigationMyAccountPage);
            });
        }