protected async override void OnNavigatedTo(NavigationEventArgs e) { object classNewsOb = (object)e.Parameter; ClassNews classNews = (ClassNews)classNewsOb; // if (e.Parameter is string && !string.IsNullOrWhiteSpace((string)e.Parameter)) // { Uri myUri = new Uri("https://yandex.ru/pogoda/moscow"); web.Source = myUri; myUri2 = myUri; await MyParser(); // } // else // { //Uri myUri = new Uri(e.Parameter.ToString()); // myUri2 = myUri; // web.Source = myUri; //} base.OnNavigatedTo(e); }
protected async override void OnNavigatedTo(NavigationEventArgs e) { object classNewsOb = (object)e.Parameter; ClassNews classNews = (ClassNews)classNewsOb; // if (e.Parameter is string && !string.IsNullOrWhiteSpace((string)e.Parameter)) // { Uri myUri = new Uri(classNews.Link); if (classNews.istochnic == "Lenta.ru") { myUri2 = myUri; await MyParser(); } else { web.Source = myUri; myUri2 = myUri; } // } // else // { //Uri myUri = new Uri(e.Parameter.ToString()); // myUri2 = myUri; // web.Source = myUri; //} base.OnNavigatedTo(e); }
private async void GridView_SelectionChanged(object sender, SelectionChangedEventArgs e) { GridView GridViewNews = sender as GridView; ClassNews classNews = (ClassNews)GridViewNews.SelectedItem; // MessageDialog messageDialog = new MessageDialog(classNews.Description); // await messageDialog.ShowAsync(); BlankPageWeb blankPageWeb = new BlankPageWeb(); blankPageWeb.hh = classNews.Link; Frame rootFrame = Window.Current.Content as Frame; rootFrame.Navigate(typeof(BlankPageWeb), classNews.Link); }
public void AddListNews(ClassNews classNews) { ListNews.Add(classNews); }