Upgrading from Xamarin to .Net Maui - Customizing Webview

Dallas Fraser 1 Reputation point
2022-05-09T14:27:22.443+00:00

Upgrading from Xamarin to .Net Maui - Customizing Webview
I need a webview that has a bridge between front-end and the webview.
This was the original guide I used for such an approach - https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/hybridwebvie...

However, trying this in .net maui I found that FormsWebViewClient is obsolete. It seems handlers are the new approach. https://github.com/dotnet/maui/pull/5322

Is there any simple example or documentation to help walk through such an approach?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,362 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,578 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 43,921 Reputation points Microsoft Vendor
    2022-05-10T02:39:00.1+00:00

    Hello,

    For Customizing Webview, you could refer to the following documentation and sample.

    Documentation: Customize controls with handlers.

    Sample: WebViewHandler.Android.cs.

    MAUI is still in preview testing, and we will improve documentations as soon as possible.:)

    Thanks for your feedback.

    Best Regards,

    Alec Liu.


    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.