/// <summary> /// Initializes a new instance of the <see cref="DialogViewModel"/> class. /// </summary> /// <param name="service">The service.</param> /// <param name="mediaItemMapper">The media item mapper.</param> public DialogViewModel(ILocalizationService translator, IYoutubeUrlParseService service, IMediaItemMapper mediaItemMapper, FileSystemViewModel fileSystemViewModel) { _translator = translator ?? throw new ArgumentNullException(nameof(translator)); _service = service ?? throw new ArgumentNullException(nameof(service)); _mediaItemMapper = mediaItemMapper ?? throw new ArgumentNullException(nameof(mediaItemMapper)); _fileSystemViewModel = fileSystemViewModel ?? throw new ArgumentNullException(nameof(fileSystemViewModel)); CloseDialogCommand = new RelayCommand(Close, () => CanClose()); CancelDialogCommand = new RelayCommand(Cancel, () => CanCancel()); AcceptDialogCommand = new RelayCommand(Accept, () => CanAccept()); ExceptionDialogViewModel = new ExceptionDialogViewModel(); MessageDialogViewModel = new MessageDialogViewModel(); ProgressDialogViewModel = new ProgressDialogViewModel(); }
public DialogViewModel(ILocalizationService translator, IYoutubeUrlParser service, IMediaItemMapper mediaItemMapper, IMessenger messenger, FileSystemViewModel fileSystemViewModel, Func <CreateMediaItem> createMediaItemFactory) { _translator = translator ?? throw new ArgumentNullException(nameof(translator), $"{nameof(translator)} {Resources.IsRequired}"); _service = service ?? throw new ArgumentNullException(nameof(service), $"{nameof(service)} {Resources.IsRequired}"); _mediaItemMapper = mediaItemMapper ?? throw new ArgumentNullException(nameof(mediaItemMapper), $"{nameof(mediaItemMapper)} {Resources.IsRequired}"); _fileSystemViewModel = fileSystemViewModel ?? throw new ArgumentNullException(nameof(fileSystemViewModel), $"{nameof(fileSystemViewModel)} {Resources.IsRequired}"); _messenger = messenger ?? throw new ArgumentNullException(nameof(messenger), $"{nameof(messenger)} {Resources.IsRequired}"); _createMediaItemFactory = createMediaItemFactory ?? throw new ArgumentNullException(nameof(createMediaItemFactory), $"{nameof(createMediaItemFactory)} {Resources.IsRequired}"); CloseDialogCommand = new RelayCommand(Close, () => CanClose()); CancelDialogCommand = new RelayCommand(Cancel, () => CanCancel()); AcceptDialogCommand = new RelayCommand(Accept, () => CanAccept()); ExceptionDialogViewModel = new ExceptionDialogViewModel(); MessageDialogViewModel = new MessageDialogViewModel(); ProgressDialogViewModel = new ProgressDialogViewModel(); }