コード例 #1
0
        private void LoadHotTopics()
        {
            isHotTopicsLoading = true;
            SetLoading();
            App.Service.HotTopics(delegate(ObservableCollection <HotTopicsViewModel> topics, bool success, string error)
            {
                isHotTopicsLoading = false;
                SetLoading();

                if (topics != null)
                {
                    ObservableCollection <TopicsGroupViewModel> newGroup = new ObservableCollection <TopicsGroupViewModel>();
                    foreach (HotTopicsViewModel hot in topics)
                    {
                        TopicsGroupViewModel newItem = new TopicsGroupViewModel(hot.Description);
                        foreach (TopicViewModel topic in hot.Topics)
                        {
                            newItem.Add(topic);
                        }
                        newGroup.Add(newItem);
                    }

                    App.ViewModel.Hot.TopicsGroupItems = newGroup;
                }
            });
        }
コード例 #2
0
        private void LoadHotTopics()
        {
            isHotTopicsLoading = true;
            SetLoading();
            App.Service.HotTopics(delegate(ObservableCollection<HotTopicsViewModel> topics, bool success, string error)
            {
                isHotTopicsLoading = false;
                SetLoading();

                if (topics != null)
                {
                    ObservableCollection<TopicsGroupViewModel> newGroup = new ObservableCollection<TopicsGroupViewModel>();
                    foreach (HotTopicsViewModel hot in topics)
                    {
                        TopicsGroupViewModel newItem = new TopicsGroupViewModel(hot.Description);
                        foreach (TopicViewModel topic in hot.Topics)
                            newItem.Add(topic);
                        newGroup.Add(newItem);
                    }

                    App.ViewModel.Hot.TopicsGroupItems = newGroup;
                }
            });
        }