Exemple #1
0
        internal async Task UpdateJavascriptObjects(bool debugMode)
        {
            await RunInJavascriptContext(async() =>
            {
                _Context.InitOnJsContext(debugMode);
                _sessionInjector = _Context.JavascriptSessionInjector;
                RegisterJavascriptHelper();
                _Root.ComputeJavascriptValue(_Context.WebView.Factory, _Context.ViewModelUpdater, _SessionCache);

                var res = await InjectInHTMLSession(_Root);
                await _sessionInjector.RegisterMainViewModel(res);

                _IsLoaded = true;
            });
        }
Exemple #2
0
        internal async Task Init(object addicionalObject)
        {
            _Root = await _Context.EvaluateOnUIContextAsync(() => _JSObjectBuilder.InternalMap(_RootObject, addicionalObject));

            await RunInJavascriptContext(async() =>
            {
                _Context.InitOnJsContext();
                _sessionInjector = _Context.JavascriptSessionInjector;
                RegisterJavascriptHelper();
                _Root.ComputeJavascriptValue(_Context.WebView.Factory, _SessionCache);

                var res = await InjectInHTMLSession(_Root);

                await _sessionInjector.RegisterMainViewModel(res);

                if (ListenToCSharp)
                {
                    ListenToCSharpChanges();
                }
                _IsListening = true;
            });
        }