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; }
private void WcDownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { try { var x = JsonConvert.DeserializeObject <Wrapper>(e.Result); _dispatcher.BeginInvoke(new Action(() => artists.SetSource(x.Artists.artist.Take(25)))); } catch (Exception ex) { } }
public DocumentationViewModel(Documentation documentation, ICommandFactory commands, IConsole console) { _searchText = String.Empty; _breadCrumb = BuildBreadCrumb(Messages.Documentation, Messages.Overview); _groups = new ObservableCollection <PanoramaGroup>(); _title = Messages.Help; _results = new ObservableCollection <HelpSection>(); _documentation = documentation; _commands = commands; _console = console; _browser = new WebBrowser { Visibility = Visibility.Hidden, Source = new Uri("about:blank") }; _browser.LoadCompleted += (s, e) => IsLoading = Visibility.Hidden; _browser.Navigated += (s, e) => Browser.SetSilent(); _info = Visibility.Visible; _loading = Visibility.Visible; _home = new RelayCommand(_ => { TabIndex = 0; Title = Messages.Help; BreadCrumb = BuildBreadCrumb(Messages.Documentation, Messages.Overview); }); _back = new RelayCommand(_ => { TabIndex = 1; Title = Messages.Help; BreadCrumb = BuildBreadCrumb(Messages.Documentation, Messages.Overview); IsLoading = Visibility.Visible; }); _more = new RelayCommand(_ => { TabIndex = 2; _browser.Navigate(_topic.Link); }); foreach (var topic in _documentation.Topics) { var pg = new PanoramaGroup(topic.Kind); var content = new List <HelpTileViewModel>(); foreach (var item in topic) { var vm = new HelpTileViewModel(this, item); content.Add(vm); } pg.SetSource(content); Groups.Add(pg); } }
private void WcDownloadStringCompleted2(object sender, DownloadStringCompletedEventArgs e) { try { var x = JsonConvert.DeserializeObject <TrackWrapper>(e.Result); _dispatcher.BeginInvoke(new Action(() => { tracks.SetSource(x.Tracks.track.Take(25)); Tracks = new ObservableCollection <Track>(x.Tracks.track.Take(25)); })); } catch (Exception ex) { } }
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)); }
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; }