protected override async void OnNavigatedTo(NavigationEventArgs e) { wp = (theWallPaper)e.Parameter; im.Source = new BitmapImage(new Uri(wp.thumbnail.small)); await im.Blur(duration : 0, delay : 0, value : 10).StartAsync(); Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += (s, a) => { if (Frame.CanGoBack) { //Frame.GoBack(); Frame.Navigate(typeof(Views.start)); a.Handled = true; } }; var bitmap = new BitmapImage(new Uri(wp.thumbnail.large)); force.Source = bitmap; bitmap.ImageOpened += (s, t) => { im.Source = bitmap; im.Blur(duration: 2000, delay: 0, value: 0).StartAsync(); }; }
public int parser(ObservableCollection <theWallPaper> wallpapers) { HtmlNode rootnode = htmlDoc.DocumentNode; //string xpathstring = "//div[@class='boxgrid']/a/img"; //HtmlNodeCollection aa = rootnode.SelectNodes(xpathstring); List <HtmlNode> images = rootnode.Descendants().Where (x => (x.Name == "div" && x.Attributes["class"] != null && x.Attributes["class"].Value.Contains("boxgrid"))).ToList(); List <string> uris = new List <string>(); foreach (var image in images) { var temp = image.Descendants("a").ToList()[0].Descendants("img").ToList()[0].GetAttributeValue("src", null); var newone = new theWallPaper("test", new Thumbnail(temp, temp)); wallpapers.Add(newone); uris.Add(temp); } //string num = rootnode.Descendants().Where // (x => (x.Name == "div" && x.Attributes["class"] != null && x.Attributes["class"].Value.Contains("header-title"))).ToList()[0].Descendants("h1").ToList()[0].InnerText; string num = rootnode.Descendants().Where (x => (x.Name == "h1" && x.Attributes["class"] != null && x.Attributes["class"].Value.Contains("center title"))).ToList()[0].Descendants("i").ToList()[0].InnerText; Regex regex = new Regex(@"\d+"); string res = regex.Match(num).Value; return(Convert.ToInt32(res)); }
private async void download_Click(object sender, RoutedEventArgs e) { theWallPaper a = (theWallPaper)((FrameworkElement)e.OriginalSource).DataContext; var mg = new manager(); await mg.download(a.thumbnail.large, 0); }
private void GridView_ItemClick(object sender, ItemClickEventArgs e) { selectedItem = (theWallPaper)e.ClickedItem; Frame.Navigate(typeof(Views.detail), selectedItem); }