基于WebView2实现的Win11桌面框架,利用插件自定义
chunhualin1
2026-08-12 97df0fb5ed49e37d1c8e0e62057bb72ba5c9eb6a
src/Moli.Desktop/WebView/IWebViewHost.cs
@@ -1,4 +1,5 @@
using Moli.Desktop.Plugins;
using System.Windows;
namespace Moli.Desktop.WebView;
@@ -8,9 +9,11 @@
    string HostId { get; }
    PluginId PluginId { get; }
    PluginType PluginType { get; }
    FrameworkElement View { get; }
    Task InitializeAsync(WebViewHostOptions options, CancellationToken cancellationToken = default);
    Task NavigateAsync(Uri entryUri, CancellationToken cancellationToken = default);
    Task InjectBridgeAsync(PluginBridgeContext context, CancellationToken cancellationToken = default);
    Task DispatchLifecycleEventAsync(string eventName, object? payload, CancellationToken cancellationToken = default);
    Task ReloadAsync(CancellationToken cancellationToken = default);
    Task NotifyParentWindowPositionChangedAsync(CancellationToken cancellationToken = default);
}