Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public ConversionConfirmationViewModel(
     IAtomexApp app,
     IDialogViewer dialogViewer)
 {
     App          = app ?? throw new ArgumentNullException(nameof(app));
     DialogViewer = dialogViewer ?? throw new ArgumentNullException(nameof(dialogViewer));
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public StartViewModel(
     IAtomixApp app,
     IDialogViewer dialogViewer)
 {
     App          = app ?? throw new ArgumentNullException(nameof(app));
     DialogViewer = dialogViewer ?? throw new ArgumentNullException(nameof(dialogViewer));
 }
        public static IWalletViewModel CreateViewModel(
            IAtomexApp app,
            IDialogViewer dialogViewer,
            IMenuSelector menuSelector,
            IConversionViewModel conversionViewModel,
            CurrencyConfig currency)
        {
            return(currency switch
            {
                BitcoinBasedConfig _ or
                Erc20Config _ or
                EthereumConfig _ => new WalletViewModel(
                    app: app,
                    dialogViewer: dialogViewer,
                    menuSelector: menuSelector,
                    conversionViewModel: conversionViewModel,
                    currency: currency),

                Fa12Config _ => new Fa12WalletViewModel(
                    app: app,
                    dialogViewer: dialogViewer,
                    menuSelector: menuSelector,
                    conversionViewModel: conversionViewModel,
                    currency: currency),

                TezosConfig _ => new TezosWalletViewModel(
                    app: app,
                    dialogViewer: dialogViewer,
                    menuSelector: menuSelector,
                    conversionViewModel: conversionViewModel,
                    currency: currency),

                _ => throw new NotSupportedException($"Can't create wallet view model for {currency.Name}. This currency is not supported."),
            });
 public FA2SendViewModel(
     IAtomexApp app,
     IDialogViewer dialogViewer,
     CurrencyConfig currency)
     : base(app, dialogViewer, currency)
 {
 }
Ejemplo n.º 7
0
        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
        }
Ejemplo n.º 8
0
        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"));
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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 MyWalletsViewModel(
            IAtomixApp app,
            IDialogViewer dialogViewer)
        {
            App          = app ?? throw new ArgumentNullException(nameof(app));
            DialogViewer = dialogViewer ?? throw new ArgumentNullException(nameof(dialogViewer));

            Wallets = WalletInfo.AvailableWallets();
        }
        public DelegateConfirmationViewModel(
            IAtomexApp app,
            IDialogViewer dialogViewer,
            Action onDelegate = null)
        {
            App          = app ?? throw new ArgumentNullException(nameof(app));
            DialogViewer = dialogViewer ?? throw new ArgumentNullException(nameof(dialogViewer));

            _onDelegate = onDelegate;
        }
 public static SendViewModel CreateViewModel(
     IAtomexApp app,
     IDialogViewer dialogViewer,
     CurrencyConfig currency)
 {
     return(currency switch
     {
         BitcoinBasedConfig _ => new BitcoinBasedSendViewModel(app, dialogViewer, currency),
         Erc20Config _ => new Erc20SendViewModel(app, dialogViewer, currency),
         EthereumConfig _ => new EthereumSendViewModel(app, dialogViewer, currency),
         //Fa2Config _          => new FA2SendViewModel(app, dialogViewer, currency),
         Fa12Config _ => new Fa12SendViewModel(app, dialogViewer, currency),
         TezosConfig _ => new TezosSendViewModel(app, dialogViewer, currency),
         _ => throw new NotSupportedException($"Can't create send view model for {currency.Name}. This currency is not supported."),
     });
 public MovieViewModelFactory(ISourceService sourceService,
                              IMovieMetadataService metadataService,
                              IFileSystemService fileSystemService,
                              IProgressManagerViewModel progressManager,
                              IKeyDataStore keyDataStore,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService         = sourceService;
     _fileSystemService     = fileSystemService;
     _metadataService       = metadataService;
     _progressManager       = progressManager;
     _keyDataStore          = keyDataStore;
     _busyProvider          = busyProvider;
     _dialogViewer          = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public MovieViewModelFactory(ISourceService sourceService,
     IMovieMetadataService metadataService,
     IFileSystemService fileSystemService,
     IProgressManagerViewModel progressManager,
     IKeyDataStore keyDataStore,
     IBusyProvider busyProvider,
     IDialogViewer dialogViewer,
     IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _metadataService = metadataService;
     _progressManager = progressManager;
     _keyDataStore = keyDataStore;
     _busyProvider = busyProvider;
     _dialogViewer = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public TvShowViewModelFactory(ISourceService sourceService,
     IFileSystemService fileSystemService,
     ITvShowFileService tvShowFileService,
     ITvShowMetadataService tvShowMetadataService,
     IEpisodeMetadataService episodeMetadataService,
     IProgressManagerViewModel progressManagerViewModel,
     IKeyDataStore keyDataStore,
     IBusyProvider busyProvider,
     IDialogViewer dialogViewer,
     IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _tvShowFileService = tvShowFileService;
     _tvShowMetadataService = tvShowMetadataService;
     _episodeMetadataService = episodeMetadataService;
     _progressManagerViewModel = progressManagerViewModel;
     _keyDataStore = keyDataStore;
     _busyProvider = busyProvider;
     _dialogViewer = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public TvShowViewModelFactory(ISourceService sourceService,
                               IFileSystemService fileSystemService,
                               ITvShowFileService tvShowFileService,
                               ITvShowMetadataService tvShowMetadataService,
                               IEpisodeMetadataService episodeMetadataService,
                               IProgressManagerViewModel progressManagerViewModel,
                               IKeyDataStore keyDataStore,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService            = sourceService;
     _fileSystemService        = fileSystemService;
     _tvShowFileService        = tvShowFileService;
     _tvShowMetadataService    = tvShowMetadataService;
     _episodeMetadataService   = episodeMetadataService;
     _progressManagerViewModel = progressManagerViewModel;
     _keyDataStore             = keyDataStore;
     _busyProvider             = busyProvider;
     _dialogViewer             = dialogViewer;
     _actorViewModelFactory    = actorViewModelFactory;
 }
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
     IAlbumMetadataService albumMetadataService,
     ISourceService sourceService,
     IFileSystemService fileSystemService,
     IMusicFileService musicFileService,
     IMusicImageService imageService,
     IMusicImageUpdater imageUpdater,
     IBusyProvider busyProvider,
     IKeyDataStore keyDataStore,
     IProgressManagerViewModel progressManager,
     IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService = albumMetadataService;
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _musicFileService = musicFileService;
     _imageService = imageService;
     _imageUpdater = imageUpdater;
     _busyProvider = busyProvider;
     _keyDataStore = keyDataStore;
     _progressManager = progressManager;
     _dialogViewer = dialogViewer;
 }
Ejemplo n.º 19
0
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
                              IAlbumMetadataService albumMetadataService,
                              ISourceService sourceService,
                              IFileSystemService fileSystemService,
                              IMusicFileService musicFileService,
                              IMusicImageService imageService,
                              IMusicImageUpdater imageUpdater,
                              IBusyProvider busyProvider,
                              IKeyDataStore keyDataStore,
                              IProgressManagerViewModel progressManager,
                              IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService  = albumMetadataService;
     _sourceService         = sourceService;
     _fileSystemService     = fileSystemService;
     _musicFileService      = musicFileService;
     _imageService          = imageService;
     _imageUpdater          = imageUpdater;
     _busyProvider          = busyProvider;
     _keyDataStore          = keyDataStore;
     _progressManager       = progressManager;
     _dialogViewer          = dialogViewer;
 }
 public SendConfirmationViewModel(IDialogViewer dialogViewer)
 {
     DialogViewer = dialogViewer ?? throw new ArgumentNullException(nameof(dialogViewer));
 }
Ejemplo n.º 21
0
 public SendConfirmationViewModel(IDialogViewer dialogViewer, int dialogId)
 {
     _dialogViewer = dialogViewer ?? throw new ArgumentNullException(nameof(dialogViewer));
     _dialogId     = dialogId;
 }
Ejemplo n.º 22
0
 public LoginViewModel(IDialogViewer dialogViewer)
 {
     DialogViewer = dialogViewer ?? throw new ArgumentNullException(nameof(dialogViewer));
 }
Ejemplo n.º 23
0
 public TrackViewModel(IBusyProvider busyProvider, IDialogViewer dialogViewer, string path)
     : base(busyProvider, dialogViewer)
 {
     Path = path;
 }
Ejemplo n.º 24
0
 protected MediaViewModel(IBusyProvider busyProvider, IDialogViewer dialogViewer, TChild dummyChild)
     : base(busyProvider, dummyChild)
 {
     _busyProvider = busyProvider;
     _dialogViewer = dialogViewer;
 }
Ejemplo n.º 25
0
 protected MediaViewModel(IBusyProvider busyProvider, IDialogViewer dialogViewer)
     : this(busyProvider, dialogViewer, null)
 {
 }