Пример #1
0
        protected override async void OnAppearing()
        {
            if (CheckConnection.validate())
            {
                bool validate = await CheckAuth.validate();

                if (validate)
                {
                    await Navigation.PushModalAsync(new Timeline());
                }
                else
                {
                    loader.IsVisible     = false;
                    formLogin.IsVisible  = true;
                    btRemember.IsVisible = true;
                }
            }
            else

            {
                App.Current.MainPage = new NavigationPage(new FailConnection());
            }

            base.OnAppearing();
        }
Пример #2
0
        protected override async void OnAppearing()
        {
            if (CheckConnection.validate())
            {
                bool validate = await CheckAuth.validate();

                if (!validate)
                {
                    App.Current.MainPage = new NavigationPage(new Login());
                }
                else
                {
                    await makeTimeline();

                    string screen = Settings.config_screen;

                    double s = Convert.ToDouble(screen);

                    MainRelative.HeightRequest = s;
                }
            }
            else
            {
                App.Current.MainPage = new NavigationPage(new FailConnection());
            }

            base.OnAppearing();
        }
Пример #3
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            bool validate = await CheckAuth.validate();

            if (validate)
            {
                await Navigation.PushAsync(new Timeline());
            }

            string endpoint = "portalib-dev-category";

            IDictionary <string, string> parameters = new Dictionary <string, string>()
            {
                { "", "" }
            };

            IDictionary <string, string> call = new Dictionary <string, string>
            {
                { "act", "categoryall" },
                { "mod", "category" }
            };

            dynamic res = await decora.Service.Run(endpoint, call, "GET", parameters);

            makeCategories(res);
        }
Пример #4
0
        protected override async void OnAppearing()
        {
            bool validate = await CheckAuth.validate();

            if (!validate)
            {
                App.Current.MainPage = new NavigationPage(new Login());
            }

            base.OnAppearing();
        }
Пример #5
0
        protected override async void OnAppearing()
        {
            bool validate = await CheckAuth.validate();

            if (!validate)
            {
                App.Current.MainPage = new NavigationPage(new Login());
            }

            base.OnAppearing();

            img_category.Source = ImageRender.display("post", "foto5.jpg");
        }
Пример #6
0
        protected override async void OnAppearing()
        {
            bool validate = await CheckAuth.validate();

            if (!validate)
            {
                App.Current.MainPage = new NavigationPage(new Login());
            }
            else
            {
                MainRelative.HeightRequest = Application.Current.MainPage.Height;

                makePost(postId);
            }
            base.OnAppearing();
        }
Пример #7
0
        protected override async void OnAppearing()
        {
            bool validate = await CheckAuth.validate();

            if (!validate)
            {
                App.Current.MainPage = new NavigationPage(new Login());
            }

            base.OnAppearing();


            string endpoint = "portalib-dev-category";

            IDictionary <string, string> parameters = new Dictionary <string, string>()
            {
                { "", "" }
            };

            IDictionary <string, string> call = new Dictionary <string, string>
            {
                { "act", "allblog" },
                { "mod", "category" }
            };

            dynamic res = await decora.Service.Run(endpoint, call, "GET", parameters);

            int c = 0;
            int i = 0;

            foreach (var item in res)
            {
                c++;
            }

            if (c > 0)
            {
                category_sel.GestureRecognizers.Add(new TapGestureRecognizer()
                {
                    Command = new Command(() =>
                    {
                        comboCategory.Focus();
                    })
                });


                List <CategoryModel> category = new List <CategoryModel>();

                Dictionary <int, string> valuess = new Dictionary <int, string>();

                foreach (var item in res)
                {
                    comboCategory.Items.Add((string)item["title"]);
                    category.Add(new CategoryModel {
                        id = Convert.ToInt32((string)item["idCategory"]), title = (string)item["title"]
                    });
                }


                comboCategory.Title = "- - -";


                comboCategory.SelectedIndexChanged += (object sender, EventArgs e) =>
                {
                    if (comboCategory.SelectedIndex != -1)
                    {
                        i = 0;
                        foreach (var itemCat in category)
                        {
                            if (comboCategory.SelectedIndex == i)
                            {
                                App.Current.MainPage = new NavigationPage(new BlogList(itemCat.id, comboCategory.Items[comboCategory.SelectedIndex]));
                            }

                            i++;
                        }
                    }
                };
            }
        }