Esempio n. 1
0
 public ChapterSelectionLVPageVM(IPageService pageService, INavigatorService navigatorService, IDirectoryService directoryService, string path)
 {
     _pageService      = pageService;
     _navigatorService = navigatorService;
     _directoryService = directoryService;
     _path             = path;
 }
 public QuizPageVM(IVocabularyParserService vocabularyParserService, INavigatorService navigatorService, IPageService pageService, string chapterPath)
 {
     _navigatorService        = navigatorService;
     _vocabularyParserService = vocabularyParserService;
     _pageService             = pageService;
     _chapterPath             = chapterPath;
 }
Esempio n. 3
0
        public SettingsViewModel(
            IAppSettings appSettings,
            INavigatorService navigatorService,
            IUpdateCheck updateCheck,
            IWindowManager windowManager,
            IHelpers helpers) : base()
        {
            _extensionValidater = new ExtensionValidater();
            _navigatorService   = navigatorService;
            _helpers            = helpers;
            _appSettings        = appSettings;
            _windowManager      = windowManager;
            _updateCheck        = updateCheck;

            SetPropeertiesFromAppSettings();

            SelectedLanguage   = Languages.Where(x => x.Code == _appSettings.Language).FirstOrDefault();
            SelectedColorTheme = ColorThemes.Where(x => x.Id == _appSettings.Theme).FirstOrDefault();

            CancelSettingsCommand               = new RelayCommand(CancelSettings);
            SaveSettingsCommand                 = new RelayCommand(SaveSettings);
            CheckForUpdatesNowCommand           = new RelayCommand(CheckForUpdatesNow);
            RestoreDefaultsCommand              = new RelayCommand(RestoreDefaults);
            RemoveImageExtensionCommand         = new RelayParameterizedCommand(item => ImageFileExtensions.Remove((string)item));
            OpenAddImageExtensionCommand        = new RelayCommand(() => IsAddingImageExtension = true);
            AddImageEtensionCommand             = new RelayCommand(AddImageExtension);
            CloseImageFileExtensopnPopupCommand = new RelayCommand(() => IsAddingImageExtension = false);
        }
Esempio n. 4
0
        public InputViewmodel(INavigatorService navigatorService)
            : base(navigatorService)
        {
            _navigatorService = navigatorService;

            ConfirmCommand = CreateCommand(Confirm);
        }
Esempio n. 5
0
 public MainWindowViewModel(Window window, INavigatorService navigatorService) : base(window)
 {
     SettingsCommand = new RelayCommand(() =>
     {
         navigatorService.NavigateToSettingsPage();
     });
     AboutCommand = new RelayCommand(About);
 }
Esempio n. 6
0
 public RoutesCatalogViewModel(IRoutesManager routesManager, INavigatorService navigatorService)
 {
     RoutesManager    = routesManager;
     NavigatorService = navigatorService;
     Routes           = RoutesManager.GetRoutesCollection(model => new RouteItemViewModel {
         Model = model
     });
 }
 public ArtistDetailViewModelFactory(ISearchService searchService, AlbumViewModelFactory albumViewModelFactory, INavigatorService navigatorSevice, IPageSwitchingService pageSwitchingService, ITrackViewModelFactory session)
 {
     if (session == null) throw new ArgumentNullException("session");
     _searchService = searchService;
     _albumViewModelFactory = albumViewModelFactory;
     this._navigatorSevice = navigatorSevice;
     this._pageSwitchingService = pageSwitchingService;
     this._session = session;
 }
Esempio n. 8
0
 public DisplayVocabsLVPageVM(INavigatorService navigatorService, IDirectoryService directoryService, List <Vocabulary> vocabs = null)
 {
     _navigatorService = navigatorService;
     _directoryService = directoryService;
     if (vocabs?.Count > 0)
     {
         Vocabs = new ObservableCollection <Vocabulary>(vocabs);
     }
 }
Esempio n. 9
0
        public Player(INavigatorService navigatorService, TVRemote tvRemote)
        {
            InitializeComponent();
            DataContext = this;
            navigator   = navigatorService;
            Channel     = navigator.CurrentPageData as Models.TVChannel;

            BackCommand = new Commands.DelegateCommand(GoBack);

            TVRemoteCommandsInit(tvRemote);
        }
Esempio n. 10
0
 public DisplayVocabsLVPageVM(INavigatorService navigatorService, IVocabularyParserService vocabularyParserService, IDirectoryService directoryService, string chapterPath = null)
 {
     _navigatorService        = navigatorService;
     _vocabularyParserService = vocabularyParserService;
     _directoryService        = directoryService;
     _chapterPath             = chapterPath;
     if (!string.IsNullOrEmpty(chapterPath))
     {
         Vocabs = new ObservableCollection <Vocabulary>(_vocabularyParserService.GetVocabularyForView(chapterPath));
     }
 }
 public ArtistDetailViewModelFactory(ISearchService searchService, AlbumViewModelFactory albumViewModelFactory, INavigatorService navigatorSevice, IPageSwitchingService pageSwitchingService, ITrackViewModelFactory session)
 {
     if (session == null)
     {
         throw new ArgumentNullException("session");
     }
     _searchService             = searchService;
     _albumViewModelFactory     = albumViewModelFactory;
     this._navigatorSevice      = navigatorSevice;
     this._pageSwitchingService = pageSwitchingService;
     this._session = session;
 }
Esempio n. 12
0
        public UploadViewModel(IFileUploader fileUploader,
                               IDialogManager dialogManager,
                               IHelpers helpers,
                               IUploadListSerializer uploadFileSerializer,
                               INavigatorService navigatorService,
                               IWikiSearchFactory wikiSearchFactory,
                               IYoutube youtube,
                               IFileFinder fileFinder,
                               IAppSettings appSettings)
        {
            _fileUploader         = fileUploader;
            _appSettings          = appSettings;
            _dialogs              = dialogManager;
            _helpers              = helpers;
            _navigatorService     = navigatorService;
            _uploadFileSerializer = uploadFileSerializer;
            _youtube              = youtube;
            _fileFinder           = fileFinder;
            _wikiSearchFactory    = wikiSearchFactory;

            UploadFiles = new UploadList(_helpers);
            ResetViewModel();

            LaunchSiteCommand = new RelayCommand(() => _helpers.LaunchProcess(_fileUploader.HomePage));
            ShowFileCommand   = new RelayParameterizedCommand((filePath) => ShowImage((string)filePath));
            SignOutCommand    = new RelayCommand(SignOut);

            // Manage upload file list commands
            AddFilesCommand    = new RelayCommand(AddFiles);
            AddFolderCommand   = new RelayCommand(AddFolder);
            RemoveFilesCommand = new RelayParameterizedCommand(RemoveFiles);
            LoadListCommand    = new RelayCommand(LoadList);
            SaveListCommand    = new RelayCommand(SaveList);

            // Upload commands
            UploadCommand = new RelayCommand(async() => await Upload());
            CancelCommand = new RelayCommand(Cancel);

            // Manage content commands
            LoadContentCommand = new RelayCommand(LoadContent);
            SaveContentCommand = new RelayCommand(SaveContent);

            // Category and Template commands (UploadPage)
            PickCategoryCommand = new RelayCommand(PickCategory);
            PickTemplateCommand = new RelayCommand(PickTemplate);

            // Category and Template commands (SearchPage)
            CancelSearchCommand   = new RelayCommand(() => _navigatorService.NavigateToUploadPage());
            AddSearchItemCommand  = new RelayParameterizedCommand(AddSearchItem);
            NextSearchCommand     = new RelayCommand(async() => await NextSearch());
            StartSearchCommand    = new RelayParameterizedCommand(async(from) => await StartSearch((string)from));
            PreviousSearchCommand = new RelayCommand(async() => await PreviousSearch());
        }
Esempio n. 13
0
        public TVChannels(INavigatorService navigatorService, TVRemote tvRemote)
        {
            InitializeComponent();
            DataContext = this;
            navigator   = navigatorService;

            FocusUpCommand   = new Commands.DelegateCommand(FocusUp);
            FocusDownCommand = new Commands.DelegateCommand(FocusDown);
            PlayCommand      = new Commands.DelegateCommand(Play);
            BackCommand      = new Commands.DelegateCommand(GoBack);

            lbChannels.SelectedIndex = 0;
            TVRemoteCommandsInit(tvRemote);
        }
Esempio n. 14
0
 public ArtistDetailViewModel(SynoItem artist, ISearchService searchService, AlbumViewModelFactory albumViewModelFactory, INavigatorService navigatorSevice, IPageSwitchingService pageSwitchingService, ITrackViewModelFactory trackViewModelFactory)
 {
     if (trackViewModelFactory == null) throw new ArgumentNullException("trackViewModelFactory");
     this.Albums = new ObservableCollection<AlbumViewModel>();
     this.ArtistName = artist.Title;
     this.SimilarArtists = new ObservableCollection<IArtistViewModel>();
     this._searchService = searchService;
     _albumViewModelFactory = albumViewModelFactory;
     _navigatorSevice = navigatorSevice;
     _pageSwitchingService = pageSwitchingService;
     _trackViewModelFactory = trackViewModelFactory;
     this.PopulateAlbumsAsync(artist);
     GetSimilarArtistsAsync(artist);
 }
Esempio n. 15
0
        public Login(INavigatorService navigatorService, TVRemote tvRemote)
        {
            navigator = navigatorService;
            InitializeComponent();

            FocusUpCommand   = new Commands.DelegateCommand(FocusUp);
            FocusDownCommand = new Commands.DelegateCommand(FocusDown);
            InputCommand     = new Commands.DelegateCommand(Input);
            LoginCommand     = new Commands.DelegateCommand(DoLogin);

            controls = new[] { tbName, tbPassword, (Control)btnLogin };
            controls[iFocusedControl].Focus();

            TVRemoteCommandsInit(tvRemote);
        }
Esempio n. 16
0
        public void Setup()
        {
            _navigatorService = A.Fake <INavigatorService>();
            _dialogs          = A.Fake <IDialogManager>();
            _passwordManager  = A.Fake <IPasswordManager>();
            _appSetttings     = A.Fake <WikiUpload.Properties.IAppSettings>();
            _password         = A.Fake <IHavePassword>();
            _fileUploader     = A.Fake <IFileUploader>();
            _helpers          = A.Fake <IHelpers>();

            _model = new LoginViewModel(_fileUploader,
                                        _navigatorService,
                                        _dialogs,
                                        _passwordManager,
                                        _helpers,
                                        _appSetttings);
        }
Esempio n. 17
0
 public ArtistDetailViewModel(SynoItem artist, ISearchService searchService, AlbumViewModelFactory albumViewModelFactory, INavigatorService navigatorSevice, IPageSwitchingService pageSwitchingService, ITrackViewModelFactory trackViewModelFactory)
 {
     if (trackViewModelFactory == null)
     {
         throw new ArgumentNullException("trackViewModelFactory");
     }
     this.Albums            = new ObservableCollection <AlbumViewModel>();
     this.ArtistName        = artist.Title;
     this.SimilarArtists    = new ObservableCollection <IArtistViewModel>();
     this._searchService    = searchService;
     _albumViewModelFactory = albumViewModelFactory;
     _navigatorSevice       = navigatorSevice;
     _pageSwitchingService  = pageSwitchingService;
     _trackViewModelFactory = trackViewModelFactory;
     this.PopulateAlbumsAsync(artist);
     GetSimilarArtistsAsync(artist);
 }
Esempio n. 18
0
        public LoginViewModel(IFileUploader fileUploader,
                              INavigatorService navigator,
                              IDialogManager dialogManager,
                              IPasswordManager passwordManager,
                              IHelpers helpers,
                              Properties.IAppSettings appSettings)
        {
            _fileUploader    = fileUploader;
            _navigator       = navigator;
            _appSettings     = appSettings;
            _dialogs         = dialogManager;
            _passwordManager = passwordManager;
            _helpers         = helpers;

            InitializeFromApplicationSettings();

            LoginCommand = new RelayParameterizedCommand(async(securePassword) => await Login(securePassword));
        }
Esempio n. 19
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public MainViewmodel(ISamplePlatformspecificService platformspecificService, ISamplePortableService portableService, INavigatorService navigatorService) : base(navigatorService)
        {
            _platformspecificService = platformspecificService;
            _portableService         = portableService;
            _navigatorService        = navigatorService;

            #region Bindable properties

            //TODO: Assign default values to the bindable properties defined above
            SampleProperty = true;

            #endregion

            #region Bindable commands

            //TODO: Assign local methods and, if desired, conditions to the bindable commands defined above
            SampleCommand = CreateCommand(SampleMethod, () => SampleProperty);

            #endregion
        }
Esempio n. 20
0
        public PageNavigatorViewModel(INavigatorService navigatorService)
        {
            this.navigatorService = navigatorService;
            ((PageNavigator)navigatorService).Loaded      += PageNavigatorViewModel_Loaded;
            WindowCommandButton.OnWindowsCommandActivated += WindowCommandButton_OnWindowsCommandActivated;

            IEventManager.GetEvent <NavigateFolderItemToken>().Subscribe((videofolder) => {
                this.navigatorService.NavigationService.Navigate(new FilePageView(navigatorService.NavigationService), videofolder);
            });

            IEventManager.GetEvent <NavigateNewPage>().Subscribe((o) =>
            {
                navigatorService.NavigationService.Navigate(o);
            });

            IEventManager.GetEvent <NavigateSearchResult>().Subscribe((o) =>
            {
                navigatorService.NavigationService.Navigate(new SearchResultPage(navigatorService.NavigationService), o);
            });
        }
Esempio n. 21
0
        public InputViewmodel(INavigatorService navigatorService) : base(navigatorService)
        {
            _navigatorService = navigatorService;

            ConfirmCommand = CreateCommand(Confirm);
        }
 public NavigatorAwareBaseViewmodel(INavigatorService navigatorService)
 {
     _navigatorService = navigatorService;
     GoBackCommand = CreateCommand(GoBack, () => CanGoBack);
 }
Esempio n. 23
0
 public ResultViewmodel(INavigatorService navigatorService) : base(navigatorService)
 {
 }
Esempio n. 24
0
 public NavigatorAwareBaseViewmodel(INavigatorService navigatorService)
 {
     _navigatorService = navigatorService;
     GoBackCommand     = CreateCommand(GoBack, () => CanGoBack);
 }
Esempio n. 25
0
 public ResultViewmodel(INavigatorService navigatorService)
     : base(navigatorService)
 {
 }
Esempio n. 26
0
 public NavigatorManagementService(ISettingsManager settingsManager, IWebService webService)
 {
     SettingsManager         = settingsManager;
     _googleNavigatorService = new GoogleNavigatorService(webService);
     _yandexNavigatorService = new YandexNavigatorService(webService);
 }
 public WelcomePageVM(INavigatorService navigatorService)
 {
     _navigatorService = navigatorService;
 }