Ejemplo n.º 1
0
        public async Task <IJSCSGlue> Map(object from, object iadditional = null)
        {
            var res = await _Context.EvaluateOnUIContextAsync(() => InternalMap(from, iadditional));

            await _Context.RunOnJavascriptContextAsync(() =>
            {
                res.ComputeJavascriptValue(_Context.WebView.Factory, _Cacher);
            });

            return(res);
        }
Ejemplo n.º 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;
            });
        }
Ejemplo n.º 3
0
 private Task <T> EvaluateInUIContextAsync <T>(Func <T> run)
 {
     return(_Context.EvaluateOnUIContextAsync(run));
 }