示例#1
0
        public void Charge()
        {
            var request = new HttpRequestGet();

            var listNews = request.GetListNews(new List<News>(), "news", Singleton.Singleton.Instance().CurrentUser.language);
            listNews.ContinueWith(delegate(Task<object> tmp)
            {
                var test = tmp.Result as List<News>;
                if (test != null)
                {
                    foreach (var item in test)
                    {
                        CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                            () =>
                            {
                                item.attachments[0].url =
                                    new Uri(UrlImage + item.attachments[0].url, UriKind.RelativeOrAbsolute).ToString();
                                ListNews.Add(item);
                            });
                    }
                }
            });
        }