예제 #1
0
        private void PopulatePanel(DynamicBrowserEn3View view)
        {
            switch (this.SelectedPosition)
            {
            case "1":


                view.Row1.Height = new GridLength(293, GridUnitType.Auto);
                view.Row2.Height = new GridLength(177, GridUnitType.Auto);
                view.Row3.Height = new GridLength(177, GridUnitType.Auto);


                this.LeftImage1 = this.ButtonsDetails[0].SelectedEngImg;
                this.LeftImage2 = this.ButtonsDetails[1].InternalEngImg;
                this.LeftImage3 = this.ButtonsDetails[2].InternalEngImg;



                break;

            case "2":

                view.Row1.Height = new GridLength(177, GridUnitType.Auto);
                view.Row2.Height = new GridLength(293, GridUnitType.Auto);
                view.Row3.Height = new GridLength(177, GridUnitType.Auto);


                this.LeftImage1 = this.ButtonsDetails[0].InternalEngImg;
                this.LeftImage2 = this.ButtonsDetails[1].SelectedEngImg;
                this.LeftImage3 = this.ButtonsDetails[2].InternalEngImg;



                break;

            case "3":

                view.Row1.Height = new GridLength(177, GridUnitType.Auto);
                view.Row2.Height = new GridLength(177, GridUnitType.Auto);
                view.Row3.Height = new GridLength(293, GridUnitType.Auto);


                this.LeftImage1 = this.ButtonsDetails[0].InternalEngImg;
                this.LeftImage2 = this.ButtonsDetails[1].InternalEngImg;
                this.LeftImage3 = this.ButtonsDetails[2].SelectedEngImg;


                break;
            }

            NotifyOfPropertyChange(() => LeftImage1);
            NotifyOfPropertyChange(() => LeftImage2);
            NotifyOfPropertyChange(() => LeftImage3);
        }
예제 #2
0
        protected override void OnViewLoaded(object view)
        {
            currentView = ((DynamicBrowserEn3View)view);

            _internetAccessBrowser = new ChromiumWebBrowser()
            {
                Address = this.HomeUrl
            };

            _internetAccessBrowser.BrowserSettings = new CefSharp.BrowserSettings()
            {
                OffScreenTransparentBackground = false,
            };

            _internetAccessBrowser.Load(this.HomeUrl);

            _internetAccessBrowser.BrowserSettings.FileAccessFromFileUrls      = CefState.Enabled;
            _internetAccessBrowser.BrowserSettings.UniversalAccessFromFileUrls = CefState.Enabled;
            _internetAccessBrowser.BrowserSettings.WebSecurity = CefState.Enabled;
            _internetAccessBrowser.BrowserSettings.Javascript  = CefState.Enabled;


            _internetAccessBrowser.RequestContext  = new RequestContext();
            _internetAccessBrowser.LifeSpanHandler = new LifeSpanHandler();

            _internetAccessBrowser.RequestHandler = new CustomRequestHandler("", log, sender, this.numberOfAvailablePagesToPrint, events);
            _internetAccessBrowser.DialogHandler  = new CustomDialogHandler();

            _internetAccessBrowser.MenuHandler = new CustomMenuHandler();

            var boundEnObject = new CustomBoundObject(this.numberOfAvailablePagesToPrint, this.log, sender, events);

            _internetAccessBrowser.RegisterJsObject("bound", boundEnObject);
            _internetAccessBrowser.FrameLoadEnd += boundEnObject.OnFrameLoadEnd;

            _internetAccessBrowser.MouseDown += _internetAccessBrowser_MouseDown;
            _internetAccessBrowser.TouchDown += _internetAccessBrowser_TouchDown;
            _internetAccessBrowser.TouchMove += _internetAccessBrowser_TouchMove;

            _internetAccessBrowser.PreviewMouseUp += _internetAccessBrowser_PreviewMouseUp;

            PopulatePanel(currentView);

            ((DynamicBrowserEn3View)view).DynamicBrowser.Children.Add(_internetAccessBrowser);



            this.RemainingTime = "30";



            this.TimeElapsed = 30;
            timer            = new DispatcherTimer();
            timer.Interval   = new TimeSpan(0, 1, 0);
            timer.Tick      += TimerTick;
            timer.Start();

            startTime     = DateTime.Now;
            UnitStartTime = DateTime.Now;

            base.OnViewLoaded(view);
        }