JumpyNET Posted March 20, 2013 Posted March 20, 2013 I am trying to convert the C# LongListSelectorSample from http://phone.codeplex.com/ to VisualBasic. Here is the original C# code (with the problematic linq-query included): private void LoadLinqMovies() { List<Movie> movies = new List<Movie>(); for (int i = 0; i < 50; ++i) { movies.Add(Movie.CreateRandom()); } var moviesByCategory = from movie in movies group movie by movie.Category into c orderby c.Key select new PublicGrouping<string, Movie>(c); linqMovies.ItemsSource = moviesByCategory; } And here is my VB attempt to populate the LongListSelector with grouped movie items: Private Sub LoadLinqMovies() Dim MovieList As New List(Of Movie) For i As Integer = 0 To 49 MovieList.Add(Movie.CreateRandom()) Next Dim MoviesByCategory = _ From OneMovie In MovieList _ Group OneMovie By Cat = OneMovie.Category _ Into GroupedMovies = Group _ Select New PublicGrouping(Of String, Movie)(GroupedMovies) Movies_LLS.ItemsSource = MoviesByCategory End Sub Apparently something goes wrong with the linq query but what? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.