Пример #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            model       = e.Parameter as AppModel;
            DataContext = e.Parameter;
            Manga m = model.CurrentManga;


            if (!m.Saved)
            {
                /*m.Chapters.Clear();
                 * HtmlDocument htmlDocument2 = new HtmlDocument();
                 * htmlDocument2.OptionFixNestedTags = true;
                 * htmlDocument2.LoadHtml(await DownloadPageStringAsync(m.Url));
                 *
                 * m.Image = htmlDocument2.DocumentNode.Descendants("div").Where(x => x.Id == "mangaimg").First().Descendants().First().Attributes["src"].Value;
                 *
                 * foreach (HtmlNode link in htmlDocument2.DocumentNode.Descendants("a").Where(x => x.Attributes.Contains("href") && x.ParentNode.OriginalName == "td" && x.ParentNode.Descendants("div").Any(y => y.Attributes["class"].Value == "chico_manga")))
                 * {
                 *  m.Chapters.Insert(0, new Chapter { Name = link.ParentNode.InnerText, Url = link.Attributes["href"].Value });
                 * }
                 *
                 * m.Description = htmlDocument2.DocumentNode.Descendants("div").Where(x => x.Id == "readmangasum").First().Descendants("p").First().InnerText;*/
            }
        }
Пример #2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (!loaded)
            {
                //loaded = true;
                model       = e.Parameter as AppModel;
                DataContext = e.Parameter;
                Manga m = model.CurrentManga;
                //img.Source = new BitmapImage(new Uri(m.Image));

                if (!m.Saved)
                {
                    // TODO maybe chapters here?
                }

                /*chapters.SelectionMode = ListViewSelectionMode.None;
                 * chapters.IsItemClickEnabled = true;
                 * chapters.ItemClick += (a, b) =>
                 * {
                 *
                 *  Frame.Navigate(typeof(ReaderPage), new object[] { (a as ListView).SelectedIndex, model.CurrentManga });
                 * };*/
            }
        }
Пример #3
0
 public AppModel()
 {
     Provider = new Mangareader();
     Current  = this;
 }
Пример #4
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     model       = e.Parameter as AppModel;
     DataContext = e.Parameter;
 }