public AlbumViewModel(IAlbum iAlbum) { _Album = iAlbum; _ImagesVM = new CollectionWithDetailVM<IAlbumPicture>(_Album.Images); var tm = Register(Album.Tracks.LiveOrderBy(t => t.TrackNumber)); _OrderedTracks = Register(tm.LiveThenBy(t => t.Path)); }
public PlayerViewModel(IMusicPlayer iMusicPlayer, IPlayListFactory iPlayListFactory) { _IMusicPlayer = iMusicPlayer; _IPlayListFactory = iPlayListFactory; _IMusicPlayer.TrackEvent += OnTrackEvent; _IMusicPlayer.TrackPlaying += TrackPlaying; _PlayList = _IPlayListFactory.CreateAlbumPlayList("Memory PlayList"); _IMusicPlayer.PlayList = _PlayList; _PlayedAlbums = new CollectionWithDetailVM<IAlbum>(_PlayList.Albums); Play = RelayCommand.Instanciate(()=>_IMusicPlayer.Mode = PlayMode.Play); Pause = RelayCommand.Instanciate(() => _IMusicPlayer.Mode = PlayMode.Paused); VolumeUp = RelayCommand.Instanciate(() => _IMusicPlayer.Volume += 0.1); VolumeDown = RelayCommand.Instanciate(() => _IMusicPlayer.Volume -= 0.1); Like = RelayCommand.Instanciate(DoLike); SeeNextAlbum = _PlayedAlbums.Next; SeePreviousAlbum = _PlayedAlbums.Previous; PlayAlbum = RelayCommand.Instanciate(DoPlayAlbum); //call to activate listeners var pa = this.PlayingAlbum; }