コード例 #1
0
 public ChapterSelectionLVPageVM(IPageService pageService, INavigatorService navigatorService, IDirectoryService directoryService, string path)
 {
     _pageService      = pageService;
     _navigatorService = navigatorService;
     _directoryService = directoryService;
     _path             = path;
 }
コード例 #2
0
 public QuizPageVM(IVocabularyParserService vocabularyParserService, INavigatorService navigatorService, IPageService pageService, string chapterPath)
 {
     _navigatorService        = navigatorService;
     _vocabularyParserService = vocabularyParserService;
     _pageService             = pageService;
     _chapterPath             = chapterPath;
 }
コード例 #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);
        }
コード例 #4
0
        public InputViewmodel(INavigatorService navigatorService)
            : base(navigatorService)
        {
            _navigatorService = navigatorService;

            ConfirmCommand = CreateCommand(Confirm);
        }
コード例 #5
0
 public MainWindowViewModel(Window window, INavigatorService navigatorService) : base(window)
 {
     SettingsCommand = new RelayCommand(() =>
     {
         navigatorService.NavigateToSettingsPage();
     });
     AboutCommand = new RelayCommand(About);
 }
コード例 #6
0
 public RoutesCatalogViewModel(IRoutesManager routesManager, INavigatorService navigatorService)
 {
     RoutesManager    = routesManager;
     NavigatorService = navigatorService;
     Routes           = RoutesManager.GetRoutesCollection(model => new RouteItemViewModel {
         Model = model
     });
 }
コード例 #7
0
 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;
 }
コード例 #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);
     }
 }
コード例 #9
0
ファイル: Player.xaml.cs プロジェクト: azerowall/patterns
        public Player(INavigatorService navigatorService, TVRemote tvRemote)
        {
            InitializeComponent();
            DataContext = this;
            navigator   = navigatorService;
            Channel     = navigator.CurrentPageData as Models.TVChannel;

            BackCommand = new Commands.DelegateCommand(GoBack);

            TVRemoteCommandsInit(tvRemote);
        }
コード例 #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));
     }
 }
コード例 #11
0
 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;
 }
コード例 #12
0
ファイル: UploadViewModel.cs プロジェクト: Aspallar/Wiki-Up
        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());
        }
コード例 #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);
        }
コード例 #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);
 }
コード例 #15
0
ファイル: Login.xaml.cs プロジェクト: azerowall/patterns
        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);
        }
コード例 #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);
        }
コード例 #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);
 }
コード例 #18
0
ファイル: LoginViewModel.cs プロジェクト: Aspallar/Wiki-Up
        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));
        }
コード例 #19
0
ファイル: MainViewmodel.cs プロジェクト: Mickeydus/mvvmbasics
        /// <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
        }
コード例 #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);
            });
        }
コード例 #21
0
        public InputViewmodel(INavigatorService navigatorService) : base(navigatorService)
        {
            _navigatorService = navigatorService;

            ConfirmCommand = CreateCommand(Confirm);
        }
コード例 #22
0
 public NavigatorAwareBaseViewmodel(INavigatorService navigatorService)
 {
     _navigatorService = navigatorService;
     GoBackCommand = CreateCommand(GoBack, () => CanGoBack);
 }
コード例 #23
0
 public ResultViewmodel(INavigatorService navigatorService) : base(navigatorService)
 {
 }
コード例 #24
0
 public NavigatorAwareBaseViewmodel(INavigatorService navigatorService)
 {
     _navigatorService = navigatorService;
     GoBackCommand     = CreateCommand(GoBack, () => CanGoBack);
 }
コード例 #25
0
 public ResultViewmodel(INavigatorService navigatorService)
     : base(navigatorService)
 {
 }
コード例 #26
0
 public NavigatorManagementService(ISettingsManager settingsManager, IWebService webService)
 {
     SettingsManager         = settingsManager;
     _googleNavigatorService = new GoogleNavigatorService(webService);
     _yandexNavigatorService = new YandexNavigatorService(webService);
 }
コード例 #27
0
 public WelcomePageVM(INavigatorService navigatorService)
 {
     _navigatorService = navigatorService;
 }