admin管理员组文章数量:1391943
I have a .Net Maui Blazor hybrid and web app solution, with the four mobile, web, shared and client projects. Most of the application is in the shared project and the mobile and web projects display them within their respective wrappers. I need to set specific starting conditions, depending on the environment. In the web project I have the following component
@page "/"
<MyAwesomeComponent @rendermode="RenderMode.InteractiveWebAssembly"/>
Which then displays MyAwesomeComponent from the shared project. If I add a similar component to the mobile project, it can't be found and if I create a mobile folder in the shared project and include the starting component the application errors with a multiple "/" starting point confliction. Can this be done?
UPDATE:
I've taught myself some XAML and made progress with the following:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=";
xmlns:x=";
xmlns:local="clr-namespace:myawesomenamespace"
xmlns:shared="clr-namespace:myawesomenamespace.myawesomeassembly;assembly=myawesomeassembly"
xmlns:blazor="clr-myawesomenamespace:Microsoft.AspNetCore.Components.WebView.Maui"
x:Class="myawesomenamespace.MainPage">
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/myawesomehtmlpage.htm">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Myawesomerazorcomponent}"/>
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentPage>
Unfortunately, none of the loaded web assemblies are interactive, despite including Rendermode.InteractiveWebAssembly
in various different locations.
This also does not include the layout component, as it bypasses the Route.razor component.
I also tried the tag <RootComponent Selector="#app" ComponentType="{x:Type shared:Route}"/>
with the appropriate xmlns pointer to my wasm project, but nothing loads.
本文标签:
版权声明:本文标题:c# - How can I add the MAUI Blazor start page to the mobile project using the .Net Maui Blazor hybrid and web app template? - St 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744756606a2623502.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论