Is it possible to create global objects in .NET MAUI
Asked Answered
A

1

0

When I saw the TabBar and the Flyout menu in .NET Maui I started wondering if its possible to create your own global object for your application. does anyone know how to do this?

(I want to add a status icon at the corner of my screen without having to manually add it to all pages.)

Antananarivo answered 4/10, 2022 at 13:29 Comment(0)
O
0

You can create a simple Floating Button and add it to your pages. You can create an image with a transparent background in your favorite editor and then assign it a location on the Page.

You can refer to the following code:

  <AbsoluteLayout>
     <!--Other components-->
     <ImageButton Source="icon.png" 
            BackgroundColor="Green"
        CornerRadius="80"
            AbsoluteLayout.LayoutFlags="PositionProportional"  
            AbsoluteLayout.LayoutBounds=".95,.95,80,80" />
</AbsoluteLayout>
Ofelia answered 5/10, 2022 at 7:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.