private async void Search(string query) { //foreach(BingImage image in Images) //{ // image.IsLoading = true; // await LoadImage(image.MediaFilePath, image.Image); // image.IsLoading = false; //} Images.Clear(); IsLoading = true; Images = await BingService.SearchImagesAsync(query, 10); IsLoading = false; }
private async void Search(string query) { //// Get the app's installation folder. //var appFolder = Windows.ApplicationModel.Package.Current.InstalledLocation; //// Get the subfolders in the current folder. //var subfoldersPromise = appFolder.GetFoldersAsync(); //subfoldersPromise.(Function getFoldersSuccess(subfolders) { // // Iterate over the results and print the list of folders // // and files to the Visual Studio Output window. // subfolders.forEach(function forEachSubfolder(folder) { // console.log(folder.name); // // To iterate over the files in each folder, // // uncomment the following lines. // // var getFilesPromise = folder.getFilesAsync(); // // getFilesPromise.done(function getFilesSuccess(files) { // // console.log(folder.name); // // files.forEach(function forEachFile(file) { // // console.log(".", file.name); // // }); // // }); // }); //}); //ObservableItemCollection<Album> list = new ObservableItemCollection<Album>(); //IReadOnlyList<StorageFolder> var = Windows.Storage.ApplicationData.Current.LocalFolder.GetFoldersAsync() IsLoading = true; ObservableItemCollection <BingImage> images = await BingService.SearchImagesAsync(query, 10); //BingImageSearchService serv = new BingImageSearchService(); //ObservableCollection<BingImage> images = await serv.SearchImagesAsync(query); if (images != null) { foreach (BingImage image in images) { PresentationItemCollection.Add(new TeamItemViewModel() { BingImage = image }); } } IsLoading = false; }