コード例 #1
0
        public ArtistDetailsPage(Artist artist)
        {
            var albumGroup = new SimpleDatabase.GroupInfo
            {
                From   = "Album",
                Params =
                {
                    { "@ArtistId", artist.Id }
                },
                Filter  = "Id in (select distinct AlbumId from song where ArtistId = @ArtistId )",
                OrderBy = "Year, NameNorm"
            };

            var panarama = new PanaramaView();

            artistAlbumsPage = new ListView
            {
                ItemsSource = new SimpleDatabaseSource <Album>(Database.Main)
                {
                    GroupInfo = albumGroup,
                    IsGrouped = false,
                },
                ItemTemplate  = new DataTemplate(typeof(MediaItemCell)),
                HasUnevenRows = true,
            };

            artistAlbumsPage.ItemSelected += ArtistAlbumsPage_ItemSelected;

            panarama.AddPage(Strings.Albums, artistAlbumsPage);
            songsViewModel = new ArtistSongsViewModel
            {
                Artist = artist,
            };
            artistSongs = new ListView
            {
                ItemsSource           = songsViewModel.Source,
                IsGroupingEnabled     = true,
                GroupDisplayBinding   = new Binding("Display"),
                GroupShortNameBinding = new Binding("Display"),
                ItemTemplate          = new DataTemplate(typeof(MediaItemCell)),
                HasUnevenRows         = true,
            };
            artistSongs.ItemSelected += ArtistSongs_ItemSelected;
            panarama.AddPage(Strings.Songs, artistSongs);
            Content = panarama;
        }
コード例 #2
0
 public ArtistSongsViewController()
 {
     model = new ArtistSongsViewModel();
     Title = model.Title;
 }