My Code:
public async Task LoadRecentlyRatedBooks()
{
RecentlyRatedBooks.Clear();
try
{
var books = await App.CurrentApplication
.BookRequests
.GetBooksByCategory(BookListCategory.News, 10, 0);
if (books != null)
{
foreach (var book in books)
{
var bookViewModel = AddBook(book);
if (bookViewModel != null)
{
RecentlyRatedBooks.Add(bookViewModel);
}
}
}
}
catch(Exception ex)
{ }
}
public async Task<IEnumerable<Book>>
GetBooksByCategory(BookListCategory category, uint limit, uint offset)
{
var request = CreateBookListURL(category, limit, offset);
var response = await client.GetResponseAsyncEx<List<Book>>(request);
return response.Data;
}
I have problem with calling code after await
statement. My application reaches the return statement in GetBooksByCategory()
method but it never reaches the code after await
statement. I tried put breakpoint to catch
-block or to line containing if (books != null)
but without success. Application never reaches these breakpoints.
Im now using Visual Studio 2010 on Windows 7. There is also Visual Studio 2012 for Desktop installed.
Im sure that my code is working on Windows 8 with Visual Studio 2012 for WP. I wonder why is it not working on Windows 7 with VS 2010.
Link to repository containing my code: https://bitbucket.org/chovik/smartlib-mu-wp