コード例 #1
0
        public ShellViewModel()
        {
            Genres = new ReactiveCollection<Genre>(Data.Genres);
            Albums = new ReactiveCollection<Album>(Data.Albums);
            Artists = new ReactiveCollection<Artist>(Data.Artists);

            albums = new PanoramaGroup("trending tracks");
            artists = new PanoramaGroup("trending artists");

            Groups = new ReactiveCollection<PanoramaGroup> { albums, artists };

            artists.SetSource(Data.Artists.Take(25));
            albums.SetSource(Data.Albums.Take(25));
        }
コード例 #2
0
        public MainWindowViewModel(Dispatcher dispatcher)
        {

            SampleData.Seed();
            Albums = SampleData.Albums;
            Artists = SampleData.Artists;
            Busy = true;
            _albums = new PanoramaGroup("trending tracks");
            _artists = new PanoramaGroup("trending artists");
            Groups = new ObservableCollection<PanoramaGroup> {_albums, _artists};

            _artists.SetSource(SampleData.Artists.Take(25));
            _albums.SetSource(SampleData.Albums.Take(25));
            Busy = false;
        }
コード例 #3
0
        public MainWindowViewModel(Dispatcher dispatcher)
        {
            _dispatcher = dispatcher;
            tracks = new PanoramaGroup("trending tracks");
            artists = new PanoramaGroup("trending artists");
            Groups = new ObservableCollection<PanoramaGroup> { tracks, artists };

            var wc = new WebClient();
            wc.DownloadStringCompleted += WcDownloadStringCompleted;
            wc.DownloadStringAsync(new Uri("http://ws.audioscrobbler.com/2.0/?method=chart.gethypedartists&api_key=b25b959554ed76058ac220b7b2e0a026&format=json"));

            var wc2 = new WebClient();
            wc2.DownloadStringCompleted += WcDownloadStringCompleted2;
            wc2.DownloadStringAsync(new Uri("http://ws.audioscrobbler.com/2.0/?method=chart.gethypedtracks&api_key=b25b959554ed76058ac220b7b2e0a026&format=json"));
        }
コード例 #4
0
        public MainWindowViewModel(Dispatcher dispatcher)
        {
            Busy = true;
            _dispatcher = dispatcher;
            tracks = new PanoramaGroup("trending tracks");
            artists = new PanoramaGroup("trending artists");
            Groups = new ObservableCollection<PanoramaGroup> { tracks, artists };

            var wc = new WebClient();
            wc.DownloadStringCompleted += WcDownloadStringCompleted;
            wc.DownloadStringAsync(new Uri("http://ws.audioscrobbler.com/2.0/?method=group.gethype&group=radiohead&api_key=c0cb068ceae0af293317a11404f9d027&format=json"));

            var wc2 = new WebClient();
            wc2.DownloadStringCompleted += WcDownloadStringCompleted2;
            wc2.DownloadStringAsync(new Uri("http://ws.audioscrobbler.com/2.0/?method=group.gethype&group=radiohead&api_key=c0cb068ceae0af293317a11404f9d027&format=json"));
        }
コード例 #5
0
        public MainWindowViewModel()
        {
            SampleData.Seed();

            // create accent color menu items for the demo
            this.AccentColors = ThemeManager.DefaultAccents
                                            .Select(a => new AccentColorMenuData() { Name = a.Name, ColorBrush = a.Resources["AccentColorBrush"] as Brush })
                                            .ToList();
            
            Albums = SampleData.Albums;
            Artists = SampleData.Artists;
            
            Busy = true;

            _albums = new PanoramaGroup("trending tracks");
            _artists = new PanoramaGroup("trending artists");

            Groups = new ObservableCollection<PanoramaGroup> { _albums, _artists };

            _artists.SetSource(SampleData.Artists.Take(25));
            _albums.SetSource(SampleData.Albums.Take(25));

            Busy = false;
        }
コード例 #6
0
        private void LoadLists()
        {
            this.ListOffers = this.dbRepo.GetJobOffers(AppSettings.OffersPerPage);
            this.ListCategories = this.dbRepo.GetCategoriesFor(false);
            NotifyOfPropertyChange(() => ListOffers);
            NotifyOfPropertyChange(() => ListCategories);

            this.PGOffers = new PanoramaGroup(Properties.Resources.menu_Offers, this.ListOffers);
            this.PGCategories = new PanoramaGroup(Properties.Resources.menu_Categories, this.ListCategories);
            this.PGOffersCategories = new ObservableCollection<PanoramaGroup> { this.PGOffers, this.PGCategories };
        }
コード例 #7
0
        private void OnProjectLoaded(IEnumerable<Project> obj)
        {
            Projects = new ObservableCollection<Project>(obj);
            PanoramaGroups = new ObservableCollection<PanoramaGroup>();
            PanoramaGroup group = new PanoramaGroup("Projects");

            PanoramaGroups.Add(group);
            group.SetSource(Projects.Select(p=>
                                                {
                                                    return new ProjectWrapper {Project = p};
                                                }));
        }