Esempio n. 1
0
        private void GridView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            GridView gridview = sender as GridView;
            var      scroll   = Load.FindChildOfType <ScrollViewer>(gridview);

            scroll.ViewChanged += async(s, a) =>
            {
                if ((scroll.VerticalOffset >= scroll.ScrollableHeight - 50 || scroll.ScrollableHeight == 0) && !isLoading)
                {
                    int count0 = gridview.Items.Count;
                    int page   = gridview.Items.Count / 20 + 1;
                    isLoading = true;
                    if (gridview.Tag.ToString() == "0")
                    {
                        var temps = await ContentServ.GetTopicListAsync(page);

                        if (temps.Count == 0)
                        {
                            return;
                        }
                        foreach (var item in temps)
                        {
                            gridview.Items.Add(item);
                        }
                        isLoading = false;
                    }
                    else
                    {
                        var temps = await ContentServ.GetEventListAsync(page);

                        if (temps.Count == 0)
                        {
                            return;
                        }
                        foreach (var item in temps)
                        {
                            gridview.Items.Add(item);
                        }
                        isLoading = false;
                    }
                }
            };
        }
Esempio n. 2
0
        private async void load()
        {
            List <Models.Topic> topic = await ContentServ.GetTopicListAsync(1);

            if (topic != null)
            {
                foreach (var item in topic)
                {
                    list_topic.Items.Add(item);
                }
            }

            list_event.Visibility = Visibility.Visible;
            List <Models.Event> events = await ContentServ.GetEventListAsync(1);

            if (events != null)
            {
                foreach (var item in events)
                {
                    list_event.Items.Add(item);
                }
            }
        }
Esempio n. 3
0
        private async void load(bool isTopic)
        {
            if (isTopic == true)
            {
                list_topic.Visibility = Visibility.Visible;
                List <Models.Topic> topic = await ContentServ.GetTopicListAsync(1);

                foreach (var item in topic)
                {
                    list_topic.Items.Add(item);
                }
            }
            if (isTopic == false)
            {
                list_event.Visibility = Visibility.Visible;
                List <Models.Event> events = await ContentServ.GetEventListAsync(1);

                foreach (var item in events)
                {
                    list_event.Items.Add(item);
                }
            }
        }