Пример #1
0
        //Event click Item in Secondery List Page >> open page
        private async void SeconderyListView_OnItemTapped(object sender, ItemTappedEventArgs e)
        {
            try
            {
                var item = e.Item as Classes.SeconderyPageItems;
                if (item != null)
                {
                    if (item.Name_page == AppResources.Label_Login)
                    {
                        await Navigation.PushModalAsync(new Login_Page());
                    }
                    else if (item.Name_page == AppResources.Label_Logout)
                    {
                        var user = Classes.SeconderyListPage.FirstOrDefault(a => a.Name_page == AppResources.Label_Logout);
                        if (user != null)
                        {
                            user.Name_page = AppResources.Label_Login;
                            user.Icon_page = IoniciconsFont.LogIn;
                        }

                        var query = Classes.ListPage.FirstOrDefault(a => a.Name_page == AppResources.Label_My_Channel);
                        if (query != null)
                        {
                            Classes.ListPage.Remove(query);
                        }
                        var query2 = Classes.ListPage.FirstOrDefault(a => a.Name_page == AppResources.Label_Liked_Videos);
                        if (query2 != null)
                        {
                            Classes.ListPage.Remove(query2);
                        }
                        var query3 = Classes.ListPage.FirstOrDefault(a => a.Name_page == AppResources.Label_PlayLists);
                        if (query3 != null)
                        {
                            Classes.ListPage.Remove(query3);
                        }
                        var query4 = Classes.ListPage.FirstOrDefault(a => a.Name_page == AppResources.Label_Upload);
                        if (query4 != null)
                        {
                            Classes.ListPage.Remove(query4);
                        }

                        PagesListView.ItemsSource   = Classes.ListPage;
                        PagesListView.HeightRequest = 50;

                        API_Request.User_logout_Http();
                        SQL_Commander.Delete_Login_Credentials();
                    }
                    else if (item.Name_page == AppResources.Label_About)
                    {
                        var URI = new Uri(Settings.WebsiteUrl + "/terms/about-us");
                        Device.OpenUri(URI);
                    }
                }
            }
            catch (Exception ex)
            {
                var exception = ex.ToString();
            }
        }