Hello @Bhuwan ,
According to your description, the CustomShell.cs
has been moved outside the Platforms folder, and the platform-specific implementation file( CustomShellRenderer.cs
) has been moved to the corresponding Platform folder.
ExportRenderer
won't be needed in .NET MAU, you can remove it.
//[assembly: ExportRenderer(typeof(CustomShell), typeof(CustomShellRenderer))]
Then you could configure renderers in the MauiProgram.cs
builder
.UseMauiApp<App>()
.ConfigureMauiHandlers(handlers => {
#if ANDROID
handlers.AddHandler(typeof(Shell), typeof(CustomShellRenderer));
#endif
})
For more details, please refer to the Wiki- Using Custom Renderers in .NET MAUI · dotnet/maui Wiki · GitHub ( Using handlers.AddCompatibilityRenderer
will cause a crash, you have to use handlers.AddHandler
)
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.