示例#1
0
        private void CustomizeInitializeComponent()
        {
            var pageVoHolder = CefViewVoHolder.Instance;

            var indexUri      = @"local://whatever/html/index.html";
            var indexJs       = new IndexJs(this);
            var asyncJsObject = new AsyncJsObject();

            asyncJsObject.Name       = "cefHost";
            asyncJsObject.BindObject = indexJs;
            var cefViewHelper = CefViewHelper.Create(asyncJsObject, indexUri);

            var indexVo = new IndexVo(GridFrontPage, cefViewHelper, indexJs);

            pageVoHolder.CefViewVos.Add("IndexVo", indexVo);

            var index2Uri           = @"local://whatever/html/index2.html";
            var index2Js            = new Index2Js(this);
            var index2AsyncJsObject = new AsyncJsObject();

            index2AsyncJsObject.Name       = "cefHost";
            index2AsyncJsObject.BindObject = index2Js;
            var index2CefViewHelper = CefViewHelper.Create(index2AsyncJsObject, index2Uri);

            var index2Vo = new Index2Vo(GridFrontPage, index2CefViewHelper, index2Js);

            pageVoHolder.CefViewVos.Add("Index2Vo", index2Vo);

            BtnLoad.Click += BtnLoad_Click;
        }
示例#2
0
        private void BtnLoad_Click(object sender, RoutedEventArgs e)
        {
            if (Helper == null)
            {
                var demoPage = @"local://whatever/html/index.html";
                Helper = CefViewHelper.Create(null, demoPage);
            }

            GridFrontPage.Children.Clear();
            Helper.AppendCefBrowser(GridFrontPage);
        }
示例#3
0
        private void CustomizeInitializeComponent()
        {
            JaegerHelper = new JaegerHelper(new CmdHelper());
            var demoPage = @"local://whatever/html/empty.html";

            Helper = CefViewHelper.Create(null, demoPage);
            GridFrontPage.Children.Clear();
            Helper.AppendCefBrowser(GridFrontPage);

            this.BtnStart.Click += BtnStart_Click;
            this.BtnStop.Click  += BtnStop_Click;
        }
示例#4
0
        private void BtnLoad_Click(object sender, RoutedEventArgs e)
        {
            if (Helper == null)
            {
                var demoPage      = @"local://whatever/html/index.html";
                var asyncJsObject = new AsyncJsObject();
                asyncJsObject.Name       = "mainWindowVo";
                asyncJsObject.BindObject = this.MainWindowJs;
                Helper = CefViewHelper.Create(asyncJsObject, demoPage);
            }

            GridFrontPage.Children.Clear();
            Helper.AppendCefBrowser(GridFrontPage);
        }
示例#5
0
        private void InitCefView()
        {
            if (Helper == null)
            {
                var entryUri      = @"local://whatever/html/index.html";
                var asyncJsObject = new AsyncJsObject();
                asyncJsObject.Name = "cefHost";
                Js = new MainPageJs(this);
                asyncJsObject.BindObject = Js;
                Helper = CefViewHelper.Create(asyncJsObject, entryUri);
            }

            GridFrontPage.Children.Clear();
            Helper.AppendCefBrowser(GridFrontPage);
        }
示例#6
0
        public static MainPageVo InitCefView(string entryUri)
        {
            new MainPageJs();
            var asyncJsObject = new AsyncJsObject();

            asyncJsObject.Name = "cefHost";
            var Vo = new MainWindowPageVo(this);

            asyncJsObject.BindObject = Vo;


            var mainPageVo = new MainPageVo();

            Helper = CefViewHelper.Create(asyncJsObject, entryUri);
        }
示例#7
0
        public void InitCefView(string entryUri)
        {
            var asyncJsObject = new AsyncJsObject();

            asyncJsObject.Name = "appHost";

            asyncJsObject.BindObject = ShellApi;

            CefView = CefViewHelper.Create(asyncJsObject, entryUri, args =>
            {
                var message = string.Format("{0} => {1}", args.Url, args.StatusCode);
                Dispatcher?.Invoke(() => { ShowMessage(message); });
            });

            CefView.AppendCefBrowser(GridForForeground);
        }
        private void BtnLoad_Click(object sender, RoutedEventArgs e)
        {
            if (TheJs != null)
            {
                return;
            }

            TheJs = new CallbackWindowJs();
            var demoPage      = @"local://whatever/html/callback.html";
            var asyncJsObject = new AsyncJsObject();

            asyncJsObject.Name       = "theVo";
            asyncJsObject.BindObject = this.TheJs;
            var helper = CefViewHelper.Create(asyncJsObject, demoPage, null);

            TheJs.MainCefViewHelper = helper;

            GridFrontPage.Children.Clear();
            helper.AppendCefBrowser(GridFrontPage);
        }