Example #1
0
        private void SetAwesomiumDefaults()
        {
            var c = new Awesomium.Core.WebCoreConfig
            {
                CustomCSS = @"body { font-family: Segoe UI, sans-serif; font-size:0.8em;}
                              ::-webkit-scrollbar { width: 12px; height: 20px; }
                              ::-webkit-scrollbar-track { background-color: white; }
                              ::-webkit-scrollbar-thumb { background-color: #B9B9B9; }
                              ::-webkit-scrollbar-thumb:hover { background-color: #000000; }",
            };

            Awesomium.Core.WebCore.Initialize(c, true);
            Awesomium.Core.WebCore.BaseDirectory = Path.Combine(
                Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
                "Themes"
                );
        }
Example #2
0
        public void SetHtml(string content)
        {
            if (Application.Current == null)
            {
                return;
            }
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                if (!awesomiumInitialised)
                {
                    var c = new Awesomium.Core.WebCoreConfig
                    {
                        CustomCSS = @"body { font-family: Segoe UI, sans-serif; font-size:0.8em;}
                              ::-webkit-scrollbar { width: 12px; height: 12px; }
                              ::-webkit-scrollbar-track { background-color: white; }
                              ::-webkit-scrollbar-thumb { background-color: #B9B9B9; }
                              ::-webkit-scrollbar-thumb:hover { background-color: #000000; }",
                    };

                    Awesomium.Core.WebCore.Initialize(c, true);
                    Awesomium.Core.WebCore.BaseDirectory = baseDirectory;
                    awesomiumInitialised = true;
                }

                Html = content;
                if (wb == null)
                {
                    return;
                }

                wb.CacheMode = new BitmapCache();
                EventHandler webControlOnLoadCompleted = null;
                webControlOnLoadCompleted = (sender, args) =>
                {
                    wb.LoadCompleted -= webControlOnLoadCompleted;
                    WbProcentualZoom();
                    wb.CacheMode = null;
                };
                wb.LoadCompleted += webControlOnLoadCompleted;
                wb.LoadHTML(content);
            }));
        }
Example #3
0
        public void SetHtml(string content)
        {
            if (Application.Current == null) return;
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                if (!awesomiumInitialised)
                {
                    var c = new Awesomium.Core.WebCoreConfig
                    {
                        CustomCSS = @"body { font-family: Segoe UI, sans-serif; font-size:0.8em;}
                              ::-webkit-scrollbar { width: 12px; height: 12px; }
                              ::-webkit-scrollbar-track { background-color: white; }
                              ::-webkit-scrollbar-thumb { background-color: #B9B9B9; }
                              ::-webkit-scrollbar-thumb:hover { background-color: #000000; }",
                    };

                    Awesomium.Core.WebCore.Initialize(c, true);
                    Awesomium.Core.WebCore.BaseDirectory = baseDirectory;
                    awesomiumInitialised = true;
                }

                Html = content;
                if (wb == null) return;

                wb.CacheMode = new BitmapCache();
                EventHandler webControlOnLoadCompleted = null;
                webControlOnLoadCompleted = (sender, args) =>
                {
                    wb.LoadCompleted -= webControlOnLoadCompleted;
                    WbProcentualZoom();
                    wb.CacheMode = null;
                };
                wb.LoadCompleted += webControlOnLoadCompleted;
                wb.LoadHTML(content);
            }));
        }