Ejemplo n.º 1
0
        public Preview()
        {
            InitializeComponent();
            Browser.Navigate(UserTemplate.Load());
            UpdatePreview           = Utility.Debounce <string>(s => Dispatcher.InvokeAsync(() => Update(s)));
            Browser.Navigating     += BrowserOnNavigating;
            Browser.PreviewKeyDown += BrowserPreviewKeyDown;

            Task.Factory.StartNew(() =>
            {
                _templateWatcher = Utility.WatchFile(UserTemplate.TemplateFile, () => Dispatcher.Invoke(UpdateTemplate));

                // kill popups
                dynamic activeX = Browser.GetType().InvokeMember("ActiveXInstance",
                                                                 BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
                                                                 null, Browser, new object[] {});

                activeX.Silent = true;
            });
        }