예제 #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 RadioStationsPage()
        {
            this.Title     = Strings.RadioStations;
            refreshCommand = new Command(() =>
            {
                Console.WriteLine("Please refresh");
            });
            var panarama = new PanaramaView();

            panarama.AddPage(Strings.RecentStations, CreateView(false));
            panarama.AddPage(Strings.MyStations, CreateView(true));
            Content = panarama;

            //this.ViewModel = new SimpleDatabaseViewModel<RadioStation> {
            //	Title = Strings.RadioStations
            //};
            this.ToolbarItems.Add(new ToolbarItem
            {
                Command         = new Command(() => PlayIFL()),
                IconImageSource = Images.DiceIcon,
            });
        }