Example #1
0
        /// <summary>
        /// Creates the ViewModels.
        /// </summary>
        /// <param name="windowManager">WindowManager used to display dialogs.</param>
        /// <param name="userAPI">Last.fm user API.</param>
        /// <param name="fileOperator">FileOperator used to interface with files.</param>
        private TabViewModel[] CreateViewModels(IExtendedWindowManager windowManager, IUserApi userAPI, IFileOperator fileOperator)
        {
            var pasteYourTasteVM = new PasteYourTasteViewModel(userAPI);

            pasteYourTasteVM.StatusUpdated += VM_StatusUpdated;;
            var csvDownloaderVM = new CSVDownloaderViewModel(windowManager, userAPI, fileOperator);

            csvDownloaderVM.StatusUpdated += VM_StatusUpdated;
            var collageCreatorVM = new CollageCreatorViewModel(windowManager, userAPI);

            collageCreatorVM.StatusUpdated += VM_StatusUpdated;
            var milestoneCheckerVM = new MilestoneCheckerViewModel(userAPI);

            milestoneCheckerVM.StatusUpdated += VM_StatusUpdated;

            return(new TabViewModel[] { pasteYourTasteVM, csvDownloaderVM, collageCreatorVM, milestoneCheckerVM });
        }
        /// <summary>
        /// Creates the ViewModels.
        /// </summary>
        /// <param name="windowManager">WindowManager used to display dialogs.</param>
        /// <param name="userAPI">Last.fm user API.</param>
        /// <param name="fileOperator">FileOperator used to interface with files.</param>
        private void CreateViewModels(IExtendedWindowManager windowManager, IUserApi userAPI, IFileOperator fileOperator)
        {
            var pasteYourTasteVM = new PasteYourTasteViewModel(userAPI);

            pasteYourTasteVM.StatusUpdated += VM_StatusUpdated;;
            var csvDownloaderVM = new CSVDownloaderViewModel(windowManager, userAPI, fileOperator);

            csvDownloaderVM.StatusUpdated += VM_StatusUpdated;
            var collageCreatorVM = new CollageCreatorViewModel(windowManager, userAPI);

            collageCreatorVM.StatusUpdated += VM_StatusUpdated;
            var milestoneCheckerVM = new MilestoneCheckerViewModel(userAPI);

            milestoneCheckerVM.StatusUpdated += VM_StatusUpdated;

            ActivateItem(pasteYourTasteVM);
            ActivateItem(csvDownloaderVM);
            ActivateItem(collageCreatorVM);
            ActivateItem(milestoneCheckerVM);

            // should be selected
            ActivateItem(pasteYourTasteVM);
        }