Пример #1
0
        private static void WebBrowserPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var instance   = (KanColleHost)d;
            var newBrowser = (WebBrowser)e.NewValue;
            var oldBrowser = (WebBrowser)e.OldValue;

            if (oldBrowser != null)
            {
                oldBrowser.LoadCompleted -= instance.HandleLoadCompleted;
                oldBrowser.LoadCompleted -= instance.ApplyFlashQualityScript;
            }
            if (newBrowser != null)
            {
                newBrowser.LoadCompleted += instance.HandleLoadCompleted;
                newBrowser.LoadCompleted += instance.ApplyFlashQualityScript;
            }
            if (instance.scrollViewer != null)
            {
                instance.scrollViewer.Content = newBrowser;
            }

            WebBrowserHelper.SetAllowWebBrowserDrop(newBrowser, false);
        }
Пример #2
0
        private static void WebBrowserPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var instance   = (KanColleHost)d;
            var newBrowser = (WebBrowser)e.NewValue;
            var oldBrowser = (WebBrowser)e.OldValue;

            if (oldBrowser != null)
            {
                oldBrowser.LoadCompleted -= instance.HandleLoadCompleted;
                newBrowser.Navigating    -= NoTouchActionStylesheet_BrowserNavigating;
            }
            if (newBrowser != null)
            {
                newBrowser.LoadCompleted += instance.HandleLoadCompleted;
                newBrowser.Navigating    += NoTouchActionStylesheet_BrowserNavigating;
            }
            if (instance.scrollViewer != null)
            {
                instance.scrollViewer.Content = newBrowser;
            }

            WebBrowserHelper.SetAllowWebBrowserDrop(newBrowser, false);
        }