Exemple #1
0
        public MainViewModel(
            IViewModelWindowManager viewModelWindowManager,
            IAppCommandHub appCommandHub,
            IUiCommandHub uiCommandHub,
            WebView2Information webView2Information,
            ForwardRuleDispatch forwardRuleDispatch,
            Func <MessageListViewModel> messageListViewModelFactory,
            Func <MessageDetailViewModel> messageDetailViewModelFactory,
            UiLogSinkQueue uiLogSinkQueue,
            AppResourceLocator resourceLocator)
        {
            this._viewModelWindowManager = viewModelWindowManager;
            this._appCommandHub          = appCommandHub;
            this._uiCommandHub           = uiCommandHub;
            this._webView2Information    = webView2Information;
            this._forwardRuleDispatch    = forwardRuleDispatch;

            this.MessageListViewModel   = messageListViewModelFactory();
            this.MessageDetailViewModel = messageDetailViewModelFactory();

            this.MessageListViewModel.ConductWith(this);
            this.MessageDetailViewModel.ConductWith(this);

            this._uiLogSinkQueue  = uiLogSinkQueue;
            this._resourceLocator = resourceLocator;

            this.LogText = webView2Information.IsInstalled
                ? this._resourceLocator.GetResourceString("LogClientSink.html")
                : "";

            this.IsWebViewInstalled = this._webView2Information.IsInstalled;

            this.SetupObservables();
        }
 public MessageDetailHtmlViewModel(ILogger logger, WebView2Information webView2Information, IHtmlPreviewGenerator previewGenerator)
 {
     this.DisplayName          = "Message";
     this._logger              = logger;
     this._webView2Information = webView2Information;
     this._previewGenerator    = previewGenerator;
     this.IsWebViewInstalled   = this._webView2Information.IsInstalled;
 }