Skip to content

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

@mediabuff

Description

@mediabuff

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

`

<title>BlazorApp2Demo</title> @(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" }))
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions