Chromium.AspNetCore.Bridge icon indicating copy to clipboard operation
Chromium.AspNetCore.Bridge copied to clipboard

Could this be made to work with BlazorWebView - in Hybrid Wpf App

Open mediabuff opened this issue 1 year ago • 7 comments

In MainWindow.xaml, I replace the webview control and took necessary steps in wiring the resource handlers. I get 'System.UriFormatException' when the view gets rendered.

New <blazor:BlazorWebView x:Name="webView" HostPage="wwwroot\index.html" Services="{StaticResource services}"> <blazor:BlazorWebView.RootComponents> <blazor:RootComponent Selector="#app" ComponentType="{x:Type local:Main}" /> </blazor:BlazorWebView.RootComponents> </blazor:BlazorWebView>

Old <wv2:WebView2 Grid.Row="0" x:Name="Browser" Source="https://cefsharp.test/" />

my Index.cshtml

`

BlazorApp2Demo @(await Html.RenderComponentAsync(RenderMode.Static, new { SectionName = "HeadCss" }))
Loading...
<div id="blazor-error-ui">
    An unhandled error has occurred.
    <a href="" class="reload">Reload</a>
    <a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webview.js"></script>
@(await Html.RenderComponentAsync<SectionComponent>(RenderMode.Static, new { SectionName = "BodyScripts" }))
`

mediabuff avatar Apr 08 '23 17:04 mediabuff