Exemplo n.º 1
0
        public Window1(OverlayStyle style)
        {
            InitializeComponent();

            if (style == OverlayStyle.WPF)
            {
                WebBrowserOverlay wbo = new WebBrowserOverlay(_webBrowserPlacementTarget);
                WebBrowser wb = wbo.WebBrowser;
                wb.Navigate(new Uri("http://live.com"));

                _showOtherButton.Content = "Show WinForms-based overlay";
            }
            else if (style == OverlayStyle.WinForms)
            {
                WebBrowserOverlayWF wbo = new WebBrowserOverlayWF(_webBrowserPlacementTarget);
                System.Windows.Forms.WebBrowser wb = wbo.WebBrowser;
                wb.Navigate(new Uri("http://live.com"));

                _showOtherButton.Content = "Show WPF-based overlay";
            }

            _showOtherButton.Click += delegate
            {
                new Window1(style == OverlayStyle.WinForms ? OverlayStyle.WPF : OverlayStyle.WinForms).Show();
            };
        }
        public Window1(OverlayStyle style)
        {
            InitializeComponent();

            if (style == OverlayStyle.WPF)
            {
                WebBrowserOverlay wbo = new WebBrowserOverlay(_webBrowserPlacementTarget);
                WebBrowser        wb  = wbo.WebBrowser;
                wb.Navigate(new Uri("http://live.com"));

                _showOtherButton.Content = "Show WinForms-based overlay";
            }
            else if (style == OverlayStyle.WinForms)
            {
                WebBrowserOverlayWF             wbo = new WebBrowserOverlayWF(_webBrowserPlacementTarget);
                System.Windows.Forms.WebBrowser wb  = wbo.WebBrowser;
                wb.Navigate(new Uri("http://live.com"));

                _showOtherButton.Content = "Show WPF-based overlay";
            }

            _showOtherButton.Click += delegate
            {
                new Window1(style == OverlayStyle.WinForms ? OverlayStyle.WPF : OverlayStyle.WinForms).Show();
            };
        }