public WebViewCompatible() : base() { if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Web.UI.Interop.WebViewControl")) { _implementation = new WebViewCompatibilityAdapter(); } else { _implementation = new WebBrowserCompatibilityAdapter(); } _implementation.Initialize(); AddChild(_implementation.View); _implementation.View.BeginInit(); _implementation.View.EndInit(); var binder = new Binding() { Source = _implementation, Path = new PropertyPath(nameof(Source)), Mode = BindingMode.TwoWay }; BindingOperations.SetBinding(this, SourceProperty, binder); }
public WebViewCompatible() : base() { if (WebViewControlHost.IsSupported) { _implementation = new WebViewCompatibilityAdapter(); } else { _implementation = new WebBrowserCompatibilityAdapter(); } _implementation.Initialize(); AddChild(_implementation.View); _implementation.View.BeginInit(); _implementation.View.EndInit(); var binder = new Binding() { Source = _implementation, Path = new PropertyPath(nameof(Source)), Mode = BindingMode.TwoWay }; BindingOperations.SetBinding(this, SourceProperty, binder); }