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.