public ReactView(bool usePreloadedWebView = true) { if (usePreloadedWebView) { view = CreateReactViewInstance(); } else { view = new ReactViewRender(false); } SetResourceReference(StyleProperty, typeof(ReactView)); // force styles to be inherited, must be called after view is created otherwise view might be null Content = view; Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action)(() => { if (!view.IsDisposing) { if (EnableHotReload) { view.EnableHotReload(Source); } view.LoadComponent(this); } })); FocusManager.SetIsFocusScope(this, true); FocusManager.SetFocusedElement(this, view.FocusableElement); }
public ReactView(bool usePreloadedWebView = true) { if (usePreloadedWebView) { view = CreateReactViewInstance(); } else { view = new ReactViewRender(); } SetResourceReference(StyleProperty, typeof(ReactView)); // force styles to be inherited, must be called after view is created otherwise view might be null Content = view; Dispatcher.BeginInvoke(DispatcherPriority.Send, (Action)(() => { if (EnableHotReload) { view.EnableHotReload(Source); } view.LoadComponent(JavascriptSource, JavascriptName, CreateNativeObject()); })); }