How to get handler of virtual view and it's platform view?

Igor Kravchenko 281 Reputation points
2022-05-05T15:39:02.947+00:00

In Xamarin Forms we can do this:

IVisualElementRenderer renderer = Platform.GetRenderer(sharedView);
var platfromView = renderer.View;

What is the equivalent in maui?
Thanks.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,176 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 38,756 Reputation points Microsoft Vendor
    2022-05-06T01:59:23.803+00:00

    Hello,

    This official sample showed how to get handler of a view. You can turn to there and search getrenderer to get the details.

    https://github.com/dotnet/maui/pull/3817/files#diff-34e349b029192505661dabf1e48dd9f35e0953d779e6536c7d66045c25bba2aaR19

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful