예제 #1
0
        public JsMainBinding(ITaskBarOverlayService taskBarOverlayService,
                             INotificationsService notificationsService,
                             IViewModelFactory viewModelFactory,
                             IDispatcherService dispatcherService,
                             ITextHelpers textHelpers)
        {
            Ensure.Argument.IsNotNull(taskBarOverlayService, nameof(taskBarOverlayService));
            Ensure.Argument.IsNotNull(notificationsService, nameof(notificationsService));
            Ensure.Argument.IsNotNull(viewModelFactory, nameof(viewModelFactory));
            Ensure.Argument.IsNotNull(dispatcherService, nameof(dispatcherService));
            Ensure.Argument.IsNotNull(textHelpers, nameof(textHelpers));

            this.taskBarOverlayService = taskBarOverlayService;
            this.notificationsService  = notificationsService;
            this.viewModelFactory      = viewModelFactory;
            this.dispatcherService     = dispatcherService;
            this.textHelpers           = textHelpers;
        }
예제 #2
0
        public MainViewModel(IJsBridgeService jsBridgeService,
                             ITaskBarOverlayService taskBarOverlayService,
                             IExternalProcessService externalProcessService,
                             IInjectScriptService injectScriptService,
                             IMessenger messenger,
                             IAppConstants appConstants)
            : base(jsBridgeService)
        {
            Ensure.Argument.IsNotNull(taskBarOverlayService, nameof(taskBarOverlayService));
            Ensure.Argument.IsNotNull(externalProcessService, nameof(externalProcessService));
            Ensure.Argument.IsNotNull(messenger, nameof(messenger));
            Ensure.Argument.IsNotNull(appConstants, nameof(appConstants));

            this.TaskBar = taskBarOverlayService;
            this.externalProcessService = externalProcessService;
            this.injectScriptService    = injectScriptService;
            this.appConstants           = appConstants;

            // Initialize variables.
            this.isLoading = true;

            // Create the browser for the main page.
            this.Browser.LifeSpanHandler = this;
            this.Browser.KeyboardHandler = this;
            this.Browser.RequestHandler  = this;
            this.BaseUrl = this.appConstants.AppUrl + this.appConstants.SignInPath;

            // Register events on the browser.
            this.Browser.FrameLoadEnd += this.Browser_FrameLoadEnd;

            // Set the default title.
            this.SetSubtitle();

            // Initialize the inject script service.
            this.injectScriptService.InitializeAsync();
        }