I currently trying out Maui and would like to keep the Maui Shell and components as the base platform. But I have found that the CollectionView with about 20 or 30 complex items becomes almost impossible to scroll and gets odd display issues. So I'm currently looking at doing the more complex displays in Razor. I have been using Razor on the web for a while and have had no problems showing many thousands of items. So 50 or 60 complex display items on a mobile phone should not be a problem. What I would like to do is not host the whole application in the BlazoeWebView, but just call up a single Razor page at a time in the BlazorWebView by either changing the "HostPage" or the "RootComponents".
<BlazorWebView HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Main}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
So far I have been unable to find the correct application structure to allow this. Any information on how to achieve this would be much appreciated.
HostPage
at wwwroot/index.html
.Selector
as Selector="#app"
ContentType
to the name of your Razor page. <ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:view="**clr-namespace:Your.Path.To.Razor.Page">
<BlazorWebView HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type view:Razor_Page_Name}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentView>