예제 #1
0
        private static void SearchArtistsCallback(SearchResultArtists searchResult)
        {
            foreach (var item in searchResult.Artists)
            {
                item.Group = App._searchResult[SearchResult.ArtistsGroupTitle];
            }

            App._searchResult.AddArtists(searchResult.Artists);
            var page = Window.Current.Content as View.GroupedCollectionPage;

            page.Groups = App._searchResult.SearchResultGroups;
        }
        public SearchResultArtists SearchArtists(string query)
        {
            string              urlEncodedQuery = this.UrlEncode(query);
            string              uri             = string.Format(@"http://ws.spotify.com/search/1/{0}.json?q={1}", "artist", urlEncodedQuery);
            HttpWebRequest      request         = WebRequest.Create(uri) as HttpWebRequest;
            SearchResultArtists searchResult    = new SearchResultArtists();

            searchResult.Info.NumberOfResults = 1;
            searchResult.Info.Query           = "artist";
            searchResult.Info.Offset          = 0;
            searchResult.Info.Page            = 1;
            searchResult.Artists.Add(new ArtistSearchResult {
                Title = "a-ha", Popularity = 5
            });

            return(searchResult);
        }
        private static void SearchArtistsCallback(SearchResultArtists searchResult)
        {
            foreach (var item in searchResult.Artists)
                item.Group = App._searchResult[SearchResult.ArtistsGroupTitle];

            App._searchResult.AddArtists(searchResult.Artists);
            var page = Window.Current.Content as View.GroupedCollectionPage;
            page.Groups = App._searchResult.SearchResultGroups;
        }