基于WebView2实现的Win11桌面框架,利用插件自定义
chunhualin1
2026-08-12 574a6a769115034f37bdecf3284545d74843816a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Moli.Desktop.Diagnostics;
using Moli.Desktop.Plugins;
using Moli.Desktop.Runtime;
 
namespace Moli.Desktop.WebView;
 
public sealed class WebViewHostFactory : IWebViewHostFactory
{
    private readonly IDiagnosticsService _diagnostics;
    private readonly IRuntimeEventBus _events;
    private readonly PluginBridgeDispatcher _bridgeDispatcher;
 
    public WebViewHostFactory(
        IDiagnosticsService diagnostics,
        IRuntimeEventBus events,
        PluginBridgeDispatcher bridgeDispatcher)
    {
        _diagnostics = diagnostics;
        _events = events;
        _bridgeDispatcher = bridgeDispatcher;
    }
 
    public IWebViewHost Create(PluginDescriptor plugin)
    {
        return new WebViewHost(plugin, _diagnostics, _events, _bridgeDispatcher);
    }
}