protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string temp; if (NavigationContext.QueryString.TryGetValue("index", out temp)) { index = temp; } newsData = new NewsPaperData(); string[] newsTitles = newsData.returnNewsTitles(); pageName.Text = newsTitles[Convert.ToInt32(index)]; }
void LoadNewsPaperData() { Items = new ObservableCollection <ItemViewModel>(); NewsPaperData nData = new NewsPaperData(); newsTitles = nData.returnNewsTitles(); newsUrls = nData.returnNewsUrls(); for (int i = 0; i < newsTitles.Length; i++) { this.NewsItems.Add(new NewsPaperViewModel() { NewsTitle = newsTitles[i], NewsUrl = newsUrls[i] }); } }