private void ReflashByLocalData() { ListItemSource.Clear(); if (LoadDataStarted != null) { LoadDataStarted(); } List <SimpleListItem> list = XMLListDataReader.ReadListData(new Uri(ContentURL, UriKind.Relative)); foreach (SimpleListItem item in list) { ListItemSource.Add(new RichListItem() { Title = item.Title, ItemType = item.ItemType, URL = item.URL, ItemTemplate = item.ItemTemplate, SubItemTemplate = item.SubItemTemplate }); } NotifyPropertyChanged("ListItemSource"); if (LoadDataCompleted != null) { LoadDataCompleted(); } }
public void OnAPILoadCompleted(String result) { ListItemSource.Clear(); if (result == null || "".Equals(result)) { HandleNullData(true); } else { List <RichListItem> listResult = new List <RichListItem>(); switch (Template) { case WeatherItemTemplate.WI_TEMPLATE_AREA: listResult = ForecastParser.Parse(result); AddForecastItems(listResult); break; case WeatherItemTemplate.WI_TEMPLATE_OBS: listResult = OBSParser.Parse(result); AddOBSItems(listResult); break; case WeatherItemTemplate.WI_TEMPLATE_WEEK: listResult = WeekParser.Parse(result); AddWeekItems(listResult); break; case WeatherItemTemplate.WI_TEMPLATE_SEA: listResult = SeaParser.Parse(result); AddSeaItems(listResult); break; case WeatherItemTemplate.WI_TEMPLATE_NEARSEA: listResult = NearSeaParser.Parse(result); AddNearSeaItems(listResult); break; case WeatherItemTemplate.WI_TEMPLATE_TIDE: listResult = TideParser.Parse(result); AddTideItems(listResult); break; case WeatherItemTemplate.WI_TEMPLATE_GLOBAL: listResult = GlobalParser.Parse(result); AddGlobalItems(listResult); break; } listResult = null; } if (LoadDataCompleted != null) { LoadDataCompleted(); } }