internal async Task UpdateJavascriptObjects(bool debugMode) { await RunInJavascriptContext(async() => { RegisterJavascriptHelper(); _Context.InitOnJsContext(debugMode); _sessionInjector = _Context.JavascriptSessionInjector; _BuilderStrategy = _BuilderStrategyFactory.GetStrategy(_Context.WebView, _SessionCache, _Context.JavascriptFrameworkIsMappingObject); _BuilderStrategy.UpdateJavascriptValue(_Root); IJavascriptObject res; if (_Context.JavascriptFrameworkIsMappingObject) { res = await InjectInHTMLSession(_Root); } else { res = _Root.JSValue; } await _sessionInjector.RegisterMainViewModel(res); _IsLoaded = true; }); }
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; }); }
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; }); }