/// <inheritdoc/>
        public override void ShowInView(IHtmlView htmlView, KeyValueList <string, string> variables, Navigation redirectedFrom)
        {
            base.ShowInView(htmlView, variables, redirectedFrom);
            _viewModel = new TransferCodeViewModel(
                Ioc.GetOrCreate <INavigationService>(),
                Ioc.GetOrCreate <ILanguageService>(),
                Ioc.GetOrCreate <ISvgIconService>(),
                Ioc.GetOrCreate <IThemeService>(),
                Ioc.GetOrCreate <IBaseUrlService>(),
                Ioc.GetOrCreate <IStoryBoardService>(),
                Ioc.GetOrCreate <IFeedbackService>());

            VueBindingShortcut[] shortcuts = new[]
            {
                new VueBindingShortcut(VueBindingShortcut.KeyEscape, nameof(TransferCodeViewModel.CancelCommand)),
                new VueBindingShortcut(VueBindingShortcut.KeyEnter, nameof(TransferCodeViewModel.OkCommand)),
            };
            VueBindings = new VueDataBinding(_viewModel, View, shortcuts);
            _viewModel.VueDataBindingScript = VueBindings.BuildVueScript();
            VueBindings.StartListening();

            string html = _viewService.GenerateHtml(_viewModel);

            View.LoadHtml(html);
        }
Beispiel #2
0
        /// <inheritdoc/>
        public override void ShowInView(IHtmlView htmlView, KeyValueList <string, string> variables)
        {
            base.ShowInView(htmlView, variables);
            _viewModel = new TransferCodeViewModel(
                Ioc.GetOrCreate <INavigationService>(),
                Ioc.GetOrCreate <ILanguageService>(),
                Ioc.GetOrCreate <ISvgIconService>(),
                Ioc.GetOrCreate <IBaseUrlService>(),
                Ioc.GetOrCreate <IStoryBoardService>(),
                Ioc.GetOrCreate <IFeedbackService>());

            Bindings.BindCommand("OkCommand", _viewModel.OkCommand);
            Bindings.BindCommand("GoBack", _viewModel.GoBackCommand);
            Bindings.BindCommand("CancelCommand", _viewModel.CancelCommand);
            Bindings.BindText("Code", () => _viewModel.Code, (v) => _viewModel.Code = v, null, null, HtmlViewBindingMode.OneWayToViewmodel);

            string html = _viewService.GenerateHtml(_viewModel);

            View.LoadHtml(html);
        }