public MainViewModel(
            ILayoutService layoutService,
            IPlaybarViewModel playbarViewModel,
            IPlaylistCollectionViewModel playlistCollectionViewModel,
            ITrackFoldersViewModel trackFoldersViewModel,
            IPlaylistEditorViewModel playlistEditorViewModel,
            ISettingsViewModel settingsViewModel
            )
        {
            AppLayout        = layoutService.AppLayout;
            PlaybarViewModel = playbarViewModel;

            Items.Add(playlistCollectionViewModel);
            Items.Add(trackFoldersViewModel);
            Items.Add(playlistEditorViewModel);
            Items.Add(settingsViewModel);

            SelectMainView();
        }
Beispiel #2
0
        public MainViewModel(
            IViewModelFactory viewModelFactory,
            ILayoutService layoutService,
            IPlaybarViewModel playbarViewModel,
            IPlaylistCollectionViewModel playlistCollectionViewModel,
            ISettingsViewModel settingsViewModel,
            ITrackFoldersViewModel trackFoldersViewModel
            )
        {
            _viewModelFactory = viewModelFactory;

            AppLayout        = layoutService.AppLayout;
            PlaybarViewModel = playbarViewModel;

            Items.Add(playlistCollectionViewModel);
            Items.Add(null); // At index = 1, select IPlaylistEditorViewModel which is lazily instantiated
            Items.Add(settingsViewModel);
            Items.Add(trackFoldersViewModel);

            SelectView(0);

            ActivateItem(PlaybarViewModel);
        }
        public PlaylistEditorViewModel(IEventAggregator eventAggregator, IViewModelFactory viewModelFactory, IContentManagerService contentManagerService, IDialogService dialogService, IPlaylistCollectionViewModel playlistCollectionViewModel)
        {
            _eventAggregator       = eventAggregator;
            _viewModelFactory      = viewModelFactory;
            _contentManagerService = contentManagerService;
            _dialogService         = dialogService;

            Items.AddRange(playlistCollectionViewModel.Playlists
                           .OfType <ICustomPlaylistViewModel>()
                           .Select(playlist => viewModelFactory.MakeViewModel <IEditPlaylistViewModel>(playlist)));
        }