public AlbumViewModel(IMusicFileService musicFileService, IAlbumMetadataService metadataService, IMusicImageUpdater imageUpdater, IMusicViewModelFactory viewModelFactory, IBusyProvider busyProvider, IDialogViewer dialogViewer, IProgressManagerViewModel progressManager, IKeyDataStore keyDataStore, IArtistViewModel artistViewModel, string path) : base(busyProvider, dialogViewer, viewModelFactory.GetTrack("dummy")) { _musicFileService = musicFileService; _metadataService = metadataService; _viewModelFactory = viewModelFactory; _busyProvider = busyProvider; _artistViewModel = artistViewModel; Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path)); Path = path; CoverArt = viewModelFactory.GetImage(true, new AlbumCoverArtImageStrategy(imageUpdater, this)); Selection = viewModelFactory.GetAlbumSelection(this); Genres = new DashDelimitedCollectionViewModel <string>(s => s); Moods = new DashDelimitedCollectionViewModel <string>(s => s); Styles = new DashDelimitedCollectionViewModel <string>(s => s); Themes = new DashDelimitedCollectionViewModel <string>(s => s); RefreshCommand = new RefreshMetadataCommand(this); UpdateCommand = new UpdateMetadataCommand(this, progressManager, busyProvider); SaveCommand = new SaveMetadataCommand(this); DeleteCommand = new DeleteMetadataCommand(this); }
public TvShowViewModel(ITvShowViewModelFactory viewModelFactory, ITvShowFileService tvShowFileService, ITvShowMetadataService metadataService, IBusyProvider busyProvider, IDialogViewer dialogViewer, IProgressManagerViewModel progressManager, IKeyDataStore keyDataStore, string path) : base(busyProvider, dialogViewer) { _viewModelFactory = viewModelFactory; _tvShowFileService = tvShowFileService; _metadataService = metadataService; _busyProvider = busyProvider; Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path)); Title.PropertyChanged += TitleValueChanged; Path = path; Selection = viewModelFactory.GetTvShowSelection(this); RefreshCommand = new RefreshMetadataCommand(this); UpdateCommand = new UpdateMetadataCommand(this, progressManager, busyProvider); SaveCommand = new SaveMetadataCommand(this); DeleteCommand = new DeleteMetadataCommand(this); Images = viewModelFactory.GetTvShowImages(this, path); ActorManager = viewModelFactory.GetActorManager(path, () => OnPropertyChanged("ActorManager")); Genres = new DashDelimitedCollectionViewModel <string>(s => s); // We need to set a "dummy" item in the collection for an arrow to appear in the TreeView since we're lazy-loading the items under it Children.Add(_viewModelFactory.GetSeason(this, "dummy")); }
public MovieSetViewModel(IFileSystemService fileSystemService, IMovieViewModelFactory viewModelFactory, IMovieMetadataService metadataService, IProgressManagerViewModel progressManager, IBusyProvider busyProvider, IDialogViewer dialogViewer, string setName) : base(busyProvider, dialogViewer, null) { _fileSystemService = fileSystemService; _metadataService = metadataService; _busyProvider = busyProvider; SetName = DisplayNameInternal = setName; Fanart = viewModelFactory.GetImage(new SetFanartImageStrategy(metadataService, this)); Poster = viewModelFactory.GetImage(new SetPosterImageStrategy(metadataService, this)); RefreshCommand = new RefreshMetadataCommand(this); UpdateCommand = new UpdateMetadataCommand(this, progressManager, busyProvider); SaveCommand = new SaveMetadataCommand(this); #pragma warning disable 4014 // Fire and forget the refresh AsyncHelper.ExecuteEventHandlerTask(this, Refresh); #pragma warning restore 4014 }
public MovieViewModel(IMovieMetadataService metadataService, IMovieViewModelFactory viewModelFactory, IFileSystemService fileSystemService, IProgressManagerViewModel progressManager, IBusyProvider busyProvider, IDialogViewer dialogViewer, IKeyDataStore keyDataStore, string path) : base(busyProvider, dialogViewer) { _metadataService = metadataService; _viewModelFactory = viewModelFactory; _fileSystemService = fileSystemService; _busyProvider = busyProvider; RefreshCommand = new RefreshMetadataCommand(this); UpdateCommand = new UpdateMetadataCommand(this, progressManager, busyProvider); SaveCommand = new SaveMetadataCommand(this); DeleteCommand = new DeleteMetadataCommand(this); Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path + "?title")); Title.PropertyChanged += TitlePropertyChanged; SetName = new StringCachedPropertyDecorator(keyDataStore, path + "?setName"); SetName.PropertyChanged += TitlePropertyChanged; Path = path; Selection = viewModelFactory.GetSelection(this); Poster = viewModelFactory.GetImage(new PosterImageStrategy(metadataService, this)); Fanart = viewModelFactory.GetImage(new FanartImageStrategy(metadataService, this)); Credits = new DashDelimitedCollectionViewModel <string>(s => s); Directors = new DashDelimitedCollectionViewModel <string>(s => s); Genres = new DashDelimitedCollectionViewModel <string>(s => s); ActorManager = viewModelFactory.GetActorManager(path, () => OnPropertyChanged("ActorManager")); }
public EpisodeViewModel(ITvShowViewModelFactory viewModelFactory, IEpisodeMetadataService metadataService, ITvShowViewModel tvShowViewModel, IProgressManagerViewModel progressManager, IBusyProvider busyProvider, IDialogViewer dialogViewer, IKeyDataStore keyDataStore, string path) : base(busyProvider, dialogViewer) { _metadataService = metadataService; _tvShowViewModel = tvShowViewModel; _busyProvider = busyProvider; Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path + "?title")); Title.PropertyChanged += CachedPropertyChanged; SeasonNumber = new RequiredPropertyDecorator <int?>(new IntCachedPropertyDecorator(keyDataStore, path + "?seasonNumber")); SeasonNumber.PropertyChanged += CachedPropertyChanged; EpisodeNumber = new RequiredPropertyDecorator <int?>(new IntCachedPropertyDecorator(keyDataStore, path + "?episodeNumber")); EpisodeNumber.PropertyChanged += CachedPropertyChanged; Path = path; Credits = new DashDelimitedCollectionViewModel <string>(s => s); Directors = new DashDelimitedCollectionViewModel <string>(s => s); ImagePath = viewModelFactory.GetImage(true); RefreshCommand = new RefreshMetadataCommand(this); UpdateCommand = new UpdateMetadataCommand(this, progressManager, busyProvider); SaveCommand = new SaveMetadataCommand(this); DeleteCommand = new DeleteMetadataCommand(this); }
public ArtistViewModel(IArtistMetadataService metadataService, IMusicViewModelFactory viewModelFactory, IMusicFileService musicFileService, IMusicImageUpdater imageUpdater, IProgressManagerViewModel progressManager, IBusyProvider busyProvider, IDialogViewer dialogViewer, IKeyDataStore keyDataStore, string path) : base(busyProvider, dialogViewer, viewModelFactory.GetAlbum("dummy", null)) { _metadataService = metadataService; _viewModelFactory = viewModelFactory; _musicFileService = musicFileService; _busyProvider = busyProvider; Name = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path)); Path = path; Fanart = viewModelFactory.GetImage(true, new ArtistFanartImageStrategy(imageUpdater, this)); Selection = viewModelFactory.GetArtistSelection(this); Genres = new DashDelimitedCollectionViewModel <string>(s => s); Moods = new DashDelimitedCollectionViewModel <string>(s => s); Styles = new DashDelimitedCollectionViewModel <string>(s => s); YearsActive = new DashDelimitedCollectionViewModel <int>(int.Parse); RefreshCommand = new RefreshMetadataCommand(this); UpdateCommand = new UpdateMetadataCommand(this, progressManager, busyProvider); SaveCommand = new SaveMetadataCommand(this); DeleteCommand = new DeleteMetadataCommand(this); }