コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }