I have an old App I wrote years ago in Xamarin and looking to update it to MAUI, and not a huge fan of writing Xaml.
I know you can render pages with straight code, so I thought I would try this with Shell as well, but can't figure out the correct context for adding flyout items.
Even the slightest attempt like the below causes unhandled win32 errors:
public partial class AppShell : Shell
{
public AppShell()
{
Items.Add(new FlyoutItem
{
Title = "test"
});
}
}
So I'm obviously going about it the wrong way. What is the correct syntax?
Okay, so I figured it out myself. I found this page which put me onto the right path: https://gist.github.com/TheBaileyBrew/f8a9d2e4668da3ec9bff9bf86d32d951
Anyway, so basically I was able to create an XAMLess AppShell.cs with essentially only this and it created the Shell instance, no problem.