/// <inheritdoc/> public ShortenedNoteViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, SearchableHtmlConverter searchableTextConverter, IRepositoryStorageService repositoryService, IFeedbackService feedbackService, ISettingsService settingsService, ICryptor cryptor, SafeListModel safes, NoteModel noteFromRepository) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl, searchableTextConverter, repositoryService, feedbackService, settingsService, cryptor, safes, noteFromRepository) { if (_unlockedContent != null) { // Create a short version for large notes, with only the first part of the note. // This is a performance improvement if there are large notes in the repository. HtmlShortener shortener = new HtmlShortener(); shortener.WantedLength = 600; // Should be enough even for settings with shortener.WantedTagNumber = 20; // small font and very height notes. string shortenedContent = shortener.Shorten(_unlockedContent); if (shortenedContent.Length != _unlockedContent.Length) { // Because the note will be truncated, we have to build the searchable content // first, before overwriting the original content. string dummy = SearchableContent; _unlockedContent = shortenedContent; } } }
/// <summary> /// Initializes a new instance of the <see cref="NoteViewModel"/> class. /// </summary> public NoteViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, SearchableHtmlConverter searchableTextConverter, IRepositoryStorageService repositoryService, IFeedbackService feedbackService, ISettingsService settingsService, ICryptor cryptor, SafeListModel safes, NoteModel noteFromRepository) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl) { _repositoryService = repositoryService; _feedbackService = feedbackService; _settingsService = settingsService; _searchableTextConverter = searchableTextConverter; _cryptor = cryptor; _safes = safes; MarkSearchableContentAsDirty(); PushNoteToOnlineStorageCommand = new RelayCommand(PushNoteToOnlineStorage); PullNoteFromOnlineStorageCommand = new RelayCommand(PullNoteFromOnlineStorage); ToggleShoppingModeCommand = new RelayCommand(ToggleShoppingMode); GoBackCommand = new RelayCommand(GoBack); Model = noteFromRepository; _unlockedContent = IsInSafe ? UnlockIfSafeOpen(Model.HtmlContent) : Model.HtmlContent; }
/// <summary> /// Initializes a new instance of the <see cref="RecycleBinViewModel"/> class. /// </summary> public RecycleBinViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, IFeedbackService feedbackService, ISettingsService settingsService, ICryptoRandomSource randomSource, IRepositoryStorageService repositoryService) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl) { _feedbackService = feedbackService; _settingsService = settingsService; _repositoryService = repositoryService; _noteCryptor = new Cryptor(NoteModel.CryptorPackageName, randomSource); RecycledNotes = new List <NoteViewModel>(); _repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository); Model = noteRepository; // Initialize commands GoBackCommand = new RelayCommand(GoBack); RestoreNoteCommand = new RelayCommand <object>(RestoreNote); EmptyRecycleBinCommand = new RelayCommand(EmptyRecycleBin); }
public OpenSafeViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, IFeedbackService feedbackService, ICryptoRandomService randomService, ISettingsService settingsService, IRepositoryStorageService repositoryService, Navigation navigationTarget) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl) { _feedbackService = feedbackService ?? throw new ArgumentNullException(nameof(feedbackService)); _randomService = randomService; _settingsService = settingsService; _repositoryService = repositoryService; _navigationTarget = navigationTarget; _repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository); Model = noteRepository; GoBackCommand = new RelayCommand(GoBack); CancelCommand = new RelayCommand(Cancel); OkCommand = new RelayCommand(Ok); ResetSafeCommand = new RelayCommand(ResetSafe); }
/// <summary> /// The OnStart() and OnNewIntent() methods have no guaranteed order, so we do all the /// work for starting up the app here, this is guaranteed to be called after them. /// </summary> protected override void OnResume() { base.OnResume(); // Turn on the view again, see OnPause(). if (_webView.Visibility != ViewStates.Visible) { _webView.Visibility = ViewStates.Visible; } INavigationService navigationService = Ioc.GetOrCreate <INavigationService>(); IStoryBoardService storyBoardService = Ioc.GetOrCreate <IStoryBoardService>(); if (!string.IsNullOrEmpty(_actionSendParameter)) { // Create new note and show it IRepositoryStorageService repositoryStorageService = Ioc.GetOrCreate <IRepositoryStorageService>(); ISettingsService settingsService = Ioc.GetOrCreate <ISettingsService>(); repositoryStorageService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository); NoteModel note = new NoteModel { BackgroundColorHex = settingsService.LoadSettingsOrDefault().DefaultNoteColorHex, HtmlContent = _actionSendParameter, }; noteRepository.Notes.Insert(0, note); repositoryStorageService.TrySaveRepository(noteRepository); _actionSendParameter = null; // create the note only once navigationService.Navigate(new Navigation(ControllerNames.Note, ControllerParameters.NoteId, note.Id.ToString())); } else if (IsStartedByOAuthRedirectIndent(storyBoardService)) { if (storyBoardService.ActiveStory is SynchronizationStoryBoard synchronizationStory) { // Create a copy of the active story, which uses the Ioc of this new process storyBoardService.ActiveStory = new SynchronizationStoryBoard(synchronizationStory); storyBoardService.ActiveStory.ContinueWith(SynchronizationStoryStepId.HandleOAuthRedirect); } } else { // Normal startup if (CanStartupWithLastNavigation(_lastNavigation)) { navigationService.Navigate(_lastNavigation); } else { navigationService.Navigate(new Navigation(ControllerNames.NoteRepository)); } IAutoSynchronizationService syncService = Ioc.GetOrCreate <IAutoSynchronizationService>(); syncService.SynchronizeAtStartup(); // no awaiting, run in background } }
public NugetRepository(INugetApiProxyManager nugetApiProxyManager, IRepositoryStorageService repositoryStorageService, IMapper mapper, IPackageManager packageManager, INugetPackageEntityService nugetPackageEntityService) { _nugetApiProxyManager = nugetApiProxyManager; _repositoryStorageService = repositoryStorageService; _mapper = mapper; _packageManager = packageManager; _nugetPackageEntityService = nugetPackageEntityService; }
/// <inheritdoc/> public IsSameRepositoryStep( Enum stepId, IStoryBoard storyBoard, ILanguageService languageService, IFeedbackService feedbackService, IRepositoryStorageService repositoryStorageService) : base(stepId, storyBoard, repositoryStorageService) { _languageService = languageService; _feedbackService = feedbackService; }
/// <summary> /// Initializes a new instance of the <see cref="AutoSynchronizationService"/> class. /// </summary> /// <param name="internetStateService">Service to check the internet connection.</param> /// <param name="settingsService">Service to get the auto sync mode. We need to be able to /// get the most current setting, the user can change this setting in the running app.</param> /// <param name="repositoryStorageService">Service to get the current repository.</param> /// <param name="navigationService">The navigation service.</param> public AutoSynchronizationService( IInternetStateService internetStateService, ISettingsService settingsService, IRepositoryStorageService repositoryStorageService, INavigationService navigationService) { _internetStateService = internetStateService; _settingsService = settingsService; _repositoryStorageService = repositoryStorageService; _navigationService = navigationService; }
public StoreCloudRepositoryToDeviceAndQuitStep( Enum stepId, IStoryBoard storyBoard, ILanguageService languageService, IFeedbackService feedbackService, IRepositoryStorageService repositoryStorageService) : base(stepId, storyBoard) { _languageService = languageService; _feedbackService = feedbackService; _repositoryStorageService = repositoryStorageService; }
/// <summary> /// Initializes a new instance of the <see cref="NoteRepositoryViewModel"/> class. /// </summary> public NoteRepositoryViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, IStoryBoardService storyBoardService, IFeedbackService feedbackService, ISettingsService settingsService, IEnvironmentService environmentService, ICryptoRandomSource randomSource, IRepositoryStorageService repositoryService) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl) { _storyBoardService = storyBoardService; _repositoryService = repositoryService; _feedbackService = feedbackService; _settingsService = settingsService; _environmentService = environmentService; _noteCryptor = new Cryptor(NoteModel.CryptorPackageName, randomSource); _searchableTextConverter = new SearchableHtmlConverter(); AllNotes = new List <NoteViewModel>(); FilteredNotes = new ObservableCollection <NoteViewModel>(); _repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository); Model = noteRepository; // Initialize commands and events ShowNoteCommand = new RelayCommand <object>(ShowNote); NewNoteCommand = new RelayCommand(NewNote); NewChecklistCommand = new RelayCommand(NewChecklist); DeleteNoteCommand = new RelayCommand <object>(DeleteNote); ClearFilterCommand = new RelayCommand(ClearFilter); SynchronizeCommand = new RelayCommand(Synchronize); ShowTransferCodeCommand = new RelayCommand(ShowTransferCode); ShowSettingsCommand = new RelayCommand(ShowSettings); ShowRecycleBinCommand = new RelayCommand(ShowRecycleBin); ShowExportCommand = new RelayCommand(ShowExport); ShowInfoCommand = new RelayCommand(ShowInfo); OpenSafeCommand = new RelayCommand(OpenSafe); CloseSafeCommand = new RelayCommand(CloseSafe); ChangeSafePasswordCommand = new RelayCommand(ChangeSafePassword); Modified = false; // If a filter was set before e.g. opening a note, set the same filter again. if (!string.IsNullOrEmpty(_lastFilter)) { Filter = _lastFilter; } }
/// <summary> /// Initializes a new instance of the <see cref="StopViewModel"/> class. /// </summary> public StopViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, IRepositoryStorageService repositoryService, IFolderPickerService folderPickerService) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl) { _repositoryService = repositoryService; _folderPickerService = folderPickerService; RecoverRepositoryCommand = new RelayCommand(RecoverRepository); }
/// <inheritdoc/> public StoreMergedRepositoryAndQuitStep( Enum stepId, IStoryBoard storyBoard, Guid noteId, PullPushDirection direction, ILanguageService languageService, IFeedbackService feedbackService, ISettingsService settingsService, ICryptoRandomService randomService, IRepositoryStorageService repositoryStorageService, ICloudStorageClientFactory cloudStorageClientFactory) : base(stepId, storyBoard, languageService, feedbackService, settingsService, randomService, repositoryStorageService, cloudStorageClientFactory) { _noteId = noteId; _direction = direction; }
public NoteRepositoryViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, IStoryBoardService storyBoardService, IFeedbackService feedbackService, ISettingsService settingsService, IEnvironmentService environmentService, ICryptoRandomSource randomSource, IRepositoryStorageService repositoryService) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl) { _storyBoardService = storyBoardService; _repositoryService = repositoryService; _feedbackService = feedbackService; _settingsService = settingsService; _environmentService = environmentService; _noteCryptor = new Cryptor(NoteModel.CryptorPackageName, randomSource); _searchableTextConverter = new SearchableHtmlConverter(); AllNotes = new List <NoteViewModel>(); FilteredNotes = new ObservableCollection <NoteViewModel>(); _repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository); Model = noteRepository; // Initialize commands and events ShowNoteCommand = new RelayCommand <Guid>(ShowNote); NewNoteCommand = new RelayCommand(NewNote); NewChecklistCommand = new RelayCommand(NewChecklist); DeleteNoteCommand = new RelayCommand <Guid>(DeleteNote); ClearFilterCommand = new RelayCommand(ClearFilter); SynchronizeCommand = new RelayCommand(Synchronize); ShowTransferCodeCommand = new RelayCommand(ShowTransferCode); ShowSettingsCommand = new RelayCommand(ShowSettings); ShowRecycleBinCommand = new RelayCommand(ShowRecycleBin); ShowInfoCommand = new RelayCommand(ShowInfo); OpenSafeCommand = new RelayCommand(OpenSafe); CloseSafeCommand = new RelayCommand(CloseSafe); ChangeSafePasswordCommand = new RelayCommand(ChangeSafePassword); OnPropertyChanged(nameof(FilterButtonMagnifierVisible)); OnPropertyChanged(nameof(FilterButtonCancelVisible)); Modified = false; }
private static NoteViewModel CreateMockedNoteViewModel(NoteModel note, IRepositoryStorageService repositoryStorageService) { return(new NoteViewModel( new Mock <INavigationService>().Object, new Mock <ILanguageService>().Object, new Mock <ISvgIconService>().Object, new Mock <IThemeService>().Object, new Mock <IBaseUrlService>().Object, new SearchableHtmlConverter(), repositoryStorageService, new Mock <IFeedbackService>().Object, new Mock <ISettingsService>().Object, new Mock <ICryptor>().Object, new SafeListModel(), new string[] { }, note)); }
public StoreMergedRepositoryAndQuitStep( int stepId, IStoryBoard storyBoard, ILanguageService languageService, IFeedbackService feedbackService, ISettingsService settingsService, ICryptoRandomService randomService, IRepositoryStorageService repositoryStorageService, ICloudStorageClientFactory cloudStorageClientFactory) : base(stepId, storyBoard) { _languageService = languageService; _feedbackService = feedbackService; _settingsService = settingsService; _cryptoRandomService = randomService; _repositoryStorageService = repositoryStorageService; _cloudStorageClientFactory = cloudStorageClientFactory; }
public NoteViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IBaseUrlService webviewBaseUrl, SearchableHtmlConverter searchableTextConverter, IRepositoryStorageService repositoryService, ISettingsService settingsService, NoteModel noteFromRepository) : base(navigationService, languageService, svgIconService, webviewBaseUrl) { _repositoryService = repositoryService; _settingsService = settingsService; _searchableTextConverter = searchableTextConverter; MarkSearchableContentAsDirty(); GoBackCommand = new RelayCommand(GoBack); Model = noteFromRepository; }
public RecycleBinViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IBaseUrlService webviewBaseUrl, IThemeService themeService, IRepositoryStorageService repositoryService) : base(navigationService, languageService, svgIconService, webviewBaseUrl) { _themeService = themeService; _repositoryService = repositoryService; RecycledNotes = new List <NoteViewModel>(); _repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel noteRepository); Model = noteRepository; // Initialize commands GoBackCommand = new RelayCommand(GoBack); RestoreNoteCommand = new RelayCommand <Guid>(RestoreNote); EmptyRecycleBinCommand = new RelayCommand(EmptyRecycleBin); }
public ExportViewModel( INavigationService navigationService, ILanguageService languageService, ISvgIconService svgIconService, IThemeService themeService, IBaseUrlService webviewBaseUrl, IFeedbackService feedbackService, ICryptoRandomSource randomSource, IRepositoryStorageService repositoryService, IFolderPickerService folderPickerService) : base(navigationService, languageService, svgIconService, themeService, webviewBaseUrl) { _feedbackService = feedbackService; _repositoryService = repositoryService; _folderPickerService = folderPickerService; _noteCryptor = new Cryptor(NoteModel.CryptorPackageName, randomSource); GoBackCommand = new RelayCommand(GoBack); CancelCommand = new RelayCommand(Cancel); OkCommand = new RelayCommand(Ok); ExportUnprotectedNotes = true; }
public RepositoryValidator(IRepositoryStorageService repositoryStorageService) { _repositoryStorageService = repositoryStorageService; RuleFor(x => x.Name).Required(); RuleFor(x => x.Description).Required(); RuleFor(x => x.Url).Required(); RuleFor(x => x.Name).Custom((name, context) => { if (_repositoryStorageService.IsDoublon(name)) { context.AddFailure("The name must be unique"); } }); RuleFor(x => x.Url).Custom((url, context) => { if (!_repositoryStorageService.HasUniqueUrl(url)) { context.AddFailure("The url must be unique"); } }); }
/// <inheritdoc/> protected override void OnPause() { base.OnPause(); try { // With turning off the view, we prevent the content of possibly encrypted notes to // become visible in the list of recent apps. _webView.Visibility = ViewStates.Invisible; INavigationService navigationService = Ioc.GetOrCreate <INavigationService>(); _lastNavigation = navigationService?.CurrentNavigation; navigationService.CurrentController?.StoreUnsavedData(); navigationService.CurrentController?.Dispose(); // Make sure that all open safes are closed. IRepositoryStorageService repositoryService = Ioc.GetOrCreate <IRepositoryStorageService>(); repositoryService.LoadRepositoryOrDefault(out NoteRepositoryModel repositoryModel); repositoryModel?.Safes.ForEach(safe => safe.Close()); } catch (Exception) { // No exception should escape here. } }
/// <inheritdoc/> public override void ShowInView(IHtmlView htmlView, KeyValueList <string, string> variables, Navigation redirectedFrom) { base.ShowInView(htmlView, variables, redirectedFrom); View.NavigationCompleted += NavigationCompletedEventHandler; IRepositoryStorageService repositoryService = Ioc.GetOrCreate <IRepositoryStorageService>(); _scrollToNote = variables?.GetValueOrDefault(ControllerParameters.NoteId); RepositoryStorageLoadResult loadResult = repositoryService.LoadRepositoryOrDefault(out _); if (loadResult != RepositoryStorageLoadResult.InvalidRepository) { _viewModel = new NoteRepositoryViewModel( Ioc.GetOrCreate <INavigationService>(), Ioc.GetOrCreate <ILanguageService>(), Ioc.GetOrCreate <ISvgIconService>(), Ioc.GetOrCreate <IThemeService>(), Ioc.GetOrCreate <IBaseUrlService>(), Ioc.GetOrCreate <IStoryBoardService>(), Ioc.GetOrCreate <IFeedbackService>(), Ioc.GetOrCreate <ISettingsService>(), Ioc.GetOrCreate <IEnvironmentService>(), Ioc.GetOrCreate <ICryptoRandomService>(), repositoryService); Bindings.BindCommand("NewNote", _viewModel.NewNoteCommand); Bindings.BindCommand("NewChecklist", _viewModel.NewChecklistCommand); Bindings.BindCommand("Synchronize", _viewModel.SynchronizeCommand); Bindings.BindCommand("ShowTransferCode", _viewModel.ShowTransferCodeCommand); Bindings.BindCommand("ShowRecycleBin", _viewModel.ShowRecycleBinCommand); Bindings.BindCommand("ShowSettings", _viewModel.ShowSettingsCommand); Bindings.BindCommand("ShowInfo", _viewModel.ShowInfoCommand); Bindings.BindCommand("OpenSafe", _viewModel.OpenSafeCommand); Bindings.BindCommand("CloseSafe", _viewModel.CloseSafeCommand); Bindings.BindCommand("ChangeSafePassword", _viewModel.ChangeSafePasswordCommand); Bindings.BindCommand("FilterButtonCancel", _viewModel.ClearFilterCommand); Bindings.BindText("TxtFilter", () => _viewModel.Filter, (value) => _viewModel.Filter = value, _viewModel, nameof(_viewModel.Filter), HtmlViewBindingMode.TwoWay); Bindings.BindVisibility("FilterButtonMagnifier", () => string.IsNullOrEmpty(_viewModel.Filter), _viewModel, nameof(_viewModel.FilterButtonMagnifierVisible), HtmlViewBindingMode.OneWayToView); Bindings.BindVisibility("FilterButtonCancel", () => !string.IsNullOrEmpty(_viewModel.Filter), _viewModel, nameof(_viewModel.FilterButtonCancelVisible), HtmlViewBindingMode.OneWayToView); Bindings.BindGeneric <object>( NotesChangedEventHandler, null, null, null, new HtmlViewBindingViewmodelNotifier(_viewModel, "Notes"), HtmlViewBindingMode.OneWayToView); Bindings.UnhandledViewBindingEvent += UnhandledViewBindingEventHandler; // Load html page and content (notes) string html = _viewService.GenerateHtml(_viewModel); string htmlNotes = _viewContentService.GenerateHtml(_viewModel); html = html.Replace("<ul id=\"note-repository\"></ul>", htmlNotes); // Replace node "note-repository" with content View.LoadHtml(html); } else { // Show error message and stop loading the application _stopViewModel = new StopViewModel( Ioc.GetOrCreate <INavigationService>(), Ioc.GetOrCreate <ILanguageService>(), Ioc.GetOrCreate <ISvgIconService>(), Ioc.GetOrCreate <IThemeService>(), Ioc.GetOrCreate <IBaseUrlService>()); string html = _viewStop.GenerateHtml(_stopViewModel); View.LoadHtml(html); } }
/// <summary> /// Initializes a new instance of the <see cref="NoteController"/> class. /// </summary> /// <param name="repositoryService">A service which can provide a note repository.</param> /// <param name="viewService">Razor view service which can generate the HTML view.</param> public NoteController(IRepositoryStorageService repositoryService, IRazorViewService viewService) : base(viewService) { _repositoryService = repositoryService; _startedWithSendToSilentnotes = false; }
public RepositoryManager(IRepositoryStorageService service, IMapper mapper, IValidator <RepositoryEntity> validator) { _service = service; _mapper = mapper; Validator = validator; }
/// <summary> /// Initializes a new instance of the <see cref="NoteController"/> class. /// </summary> /// <param name="repositoryService">A service which can provide a note repository.</param> /// <param name="viewService">Razor view service which can generate the HTML view.</param> public NoteController(IRepositoryStorageService repositoryService, IRazorViewService viewService) : base(viewService) { _repositoryService = repositoryService; }
/// <inheritdoc/> public override void ShowInView(IHtmlView htmlView, KeyValueList <string, string> variables, Navigation redirectedFrom) { base.ShowInView(htmlView, variables, redirectedFrom); IRepositoryStorageService repositoryService = Ioc.GetOrCreate <IRepositoryStorageService>(); _scrollToNote = variables?.GetValueOrDefault(ControllerParameters.NoteId); RepositoryStorageLoadResult loadResult = repositoryService.LoadRepositoryOrDefault(out _); if (loadResult != RepositoryStorageLoadResult.InvalidRepository) { _viewModel = new NoteRepositoryViewModel( Ioc.GetOrCreate <INavigationService>(), Ioc.GetOrCreate <ILanguageService>(), Ioc.GetOrCreate <ISvgIconService>(), Ioc.GetOrCreate <IThemeService>(), Ioc.GetOrCreate <IBaseUrlService>(), Ioc.GetOrCreate <IStoryBoardService>(), Ioc.GetOrCreate <IFeedbackService>(), Ioc.GetOrCreate <ISettingsService>(), Ioc.GetOrCreate <IEnvironmentService>(), Ioc.GetOrCreate <ICryptoRandomService>(), repositoryService); VueBindingShortcut[] shortcuts = new[] { new VueBindingShortcut("s", nameof(_viewModel.SynchronizeCommand)) { Ctrl = true }, new VueBindingShortcut("n", nameof(_viewModel.NewNoteCommand)) { Ctrl = true }, new VueBindingShortcut("l", nameof(_viewModel.NewChecklistCommand)) { Ctrl = true }, new VueBindingShortcut("r", nameof(_viewModel.ShowRecycleBinCommand)) { Ctrl = true }, new VueBindingShortcut("i", nameof(_viewModel.ShowInfoCommand)) { Ctrl = true }, new VueBindingShortcut(VueBindingShortcut.KeyHome, "ScrollToTop") { Ctrl = true }, new VueBindingShortcut(VueBindingShortcut.KeyEnd, "ScrollToBottom") { Ctrl = true }, }; VueBindings = new VueDataBinding(_viewModel, View, shortcuts); VueBindings.DeclareAdditionalVueMethod("ScrollToTop", "scrollToTop();"); VueBindings.DeclareAdditionalVueMethod("ScrollToBottom", "scrollToBottom();"); _viewModel.VueDataBindingScript = VueBindings.BuildVueScript(); VueBindings.UnhandledViewBindingEvent += UnhandledViewBindingEventHandler; VueBindings.ViewLoadedEvent += ViewLoadedEventHandler; VueBindings.StartListening(); _viewModel.PropertyChanged += ViewmodelPropertyChangedEventHandler; string html = _viewService.GenerateHtml(_viewModel); View.LoadHtml(html); } else { // Show error message and stop loading the application _stopViewModel = new StopViewModel( Ioc.GetOrCreate <INavigationService>(), Ioc.GetOrCreate <ILanguageService>(), Ioc.GetOrCreate <ISvgIconService>(), Ioc.GetOrCreate <IThemeService>(), Ioc.GetOrCreate <IBaseUrlService>()); string html = _viewStop.GenerateHtml(_stopViewModel); View.LoadHtml(html); } }
public IsSameRepositoryStep(Enum stepId, IStoryBoard storyBoard, IRepositoryStorageService repositoryStorageService) : base(stepId, storyBoard) { _repositoryStorageService = repositoryStorageService; }