Ejemplo n.º 1
0
        private void sc_ViewChanging(object sender, ScrollViewerViewChangingEventArgs e)
        {
            if (sc.VerticalOffset > 0 && sc.ScrollableHeight > 150)
            {
                if (sc.VerticalOffset >= sc.ScrollableHeight - 140 && bbb == false)
                {
                    WebSite webSite    = comboSearch.SelectedItem as WebSite;
                    string  SearchWord = txtSearch.Text;
                    page++;
                    string createAddress;
                    if (webSite.IsSearcher == null)
                    {
                        createAddress = string.Format(Constants.SearchAddressWithPage,
                                                      webSite.Name.ToLower(), SearchWord, page);
                    }
                    else
                    {
                        createAddress = string.Format(Constants.SearcherInOneAddressWithPage,
                                                      webSite.Name.ToLower(), SearchWord, page);
                    }

                    webGard.Begin(createAddress);
                    bbb = true;
                }
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            object[] obj = e.Parameter as object[];
            site     = obj[0] as WebSite;
            siteName = site.Name;
            Music music = obj[1] as Music;

            if (!string.IsNullOrEmpty(siteName) && music != null)
            {
                if (site.IsSearcher == null)
                {
                    string createUrl = string.Format(Constants.DownloadLinkAddress,
                                                     siteName.ToLower(), music.Url);
                    webGard.Begin(createUrl);
                    if (!string.IsNullOrEmpty(music.ImageUrl))
                    {
                        var image = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(music.ImageUrl));
                        img.Source = image;
                    }
                }
                else
                {
                    LV.Items.Add("Searcher site has download link.");
                    LV.Items.Add("No need to get them!");
                }
            }
        }
Ejemplo n.º 3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            site             = e.Parameter as WebSite;
            siteName         = site.Name;
            txtSiteName.Text = siteName;
            if (!string.IsNullOrEmpty(siteName))
            {
                string createAddress;
                if (site.IsSearcher != null)
                {
                    return;
                }
                else
                {
                    createAddress = string.Format(Constants.Address, siteName.ToLower());
                }

                webGard.Begin(createAddress);
            }
        }