protected TabViewModelBase(IAudioSearcherFactory audioSearcherFactory, IDataContextService database, PopUpMessageService popUpMessageService, ConfigService configService, MessageHub hub) : base(database, hub) { _audioSearcherFactory = audioSearcherFactory; _configService = configService; PopUpMessageService = popUpMessageService; CreateCommands(); SetConfigVariables(); }
private void OnContinueLearningClicked(object sender, EventArgs e) { if (MainPageViewModel.learningWordList.GetNextWord() != null) { Navigation.PushAsync(new LearningPage()); } else { PopUpMessageService.GeneratePopUpMessage("You've done your best today! Come tomorrow!"); } }
public StartupViewModel(IDataContextService database, PopUpMessageService ratingService, ConfigService configService, MessageHub hub) : base(database, hub) { _ratingService = ratingService; _configService = configService; RegisterEvents(); CreateCommands(); SetConfigVariables(); ProductVersion = App.Version; }
public AboutViewModel(PopUpMessageService ratingService, ConfigService configService) { AppTitle = AppResources.About_AppTitle; CompanyUrl = AppResources.About_CompanyUrl; FacebookUrl = AppResources.About_FacebookUrl; Copyright = AppResources.About_Copyright; SupportEmail = AppResources.About_SupportEmail; Support = AppResources.About_Support; ApplicationVersion = App.Version; _ratingService = ratingService; _configService = configService; IsAdEnabled = _configService.AdEnabled; }
public static MainWordList OpenMainWordList() { MainWordList list; if (FileHandlerService.FileExists("dictionary.dat")) { list = FileHandlerService.OpenMainWordList(); } else { list = new MainWordList(); PopUpMessageService.GeneratePopUpMessage("New dictionary has been created"); } return(list); }
void UpdateOrLeavePage() { currentWord = learningWordList.GetNextWord(); if (currentWord == null) { Navigation.PopAsync(); PopUpMessageService.GeneratePopUpMessage("Great! There are no words left for today!"); } else { OriginalWord = currentWord.Translation; Translation = string.Empty; NotifyPropertyChanged(nameof(OriginalWord)); NotifyPropertyChanged(nameof(Translation)); NotifyPropertyChanged(nameof(LearniningWordsInfo)); } }
public AddNewWordPageViewModel() { AddNewWord = new Command(() => { if (!string.IsNullOrEmpty(Word) && !string.IsNullOrEmpty(Translate)) { mainWordList.Add(new Word(Word, Translate)); if (DPage != null) { DPage.UpdateDictionary(); } PopUpMessageService.GeneratePopUpMessage($"Word ' {Word} - {Translate} ' added"); this.Word = string.Empty; this.Translate = string.Empty; NotifyPropertyChanged(nameof(Word)); NotifyPropertyChanged(nameof(Translate)); } else { PopUpMessageService.GeneratePopUpMessage("Error"); } }); }
private void RunPopUpMessages() { //Run if ads are enabled only if (IsAdEnabled) { // Run the App rate or review if (!PopUpMessageService.IsAppRated() && PopUpMessageService.IsNeedShowRatingMessage()) { MessageBoxResult result = MessageBox.Show(AppResources.Tab_ReviewTheApp, AppResources.Tab_RateTheApp, MessageBoxButton.OKCancel); //show message. if (result == MessageBoxResult.OK) { PopUpMessageService.RateApp(); new MarketplaceReviewTask().Show(); } } //Ask for purchasing the pro - a one time question. if (PopUpMessageService.IsNeedShowPurchaseProMessage()) { MessageBoxResult result = MessageBox.Show(AppResources.Tab_PurchaseProText, AppResources.Tab_PurchaseProHeader, MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask(); //Change the app GUID to the pro version marketplaceDetailTask.ContentIdentifier = "00a9816d-8059-4ebb-aff7-277f0b5366b1"; marketplaceDetailTask.ContentType = MarketplaceContentType.Applications; marketplaceDetailTask.Show(); } } } }
public TextTabViewModel(IAudioSearcherFactory audioSearcherFactory, IDataContextService database, PopUpMessageService popUpMessageService, ConfigService configService, MessageHub hub) : base(audioSearcherFactory, database, popUpMessageService, configService, hub) { _textTabAdapter = new TextTabAdapter(); }
public StaveTabViewModel(IAudioSearcherFactory audioSearcherFactory, IDataContextService database, PopUpMessageService popUpService, ConfigService configService, MessageHub hub) : base(audioSearcherFactory, database, popUpService, configService, hub) { CreateCommands(); }