.NET MAUI – Forget Me Not – Part 2

In Part 1 we created the skeleton of Forget Me Not (and explained what it is). Here in Part 2 we’ll add an about page. This is so easy that this will be a short post.

Create the page

Creating the page is almost indistinguishable from doing so in Xamarin.Forms. Here’s the XAML for the page:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="ForgetMeNot.About"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
    <VerticalStackLayout Margin="10" Spacing="10">
        <HorizontalStackLayout Spacing="10">
            <Image HeightRequest="64" Source="flower.png" />
            <Label
                FontAttributes="Bold"
                FontSize="22"
                Text="About this app"
                VerticalOptions="End" />
            <Label
                FontSize="22"
                Text="v1.0"
                VerticalOptions="End" />
        </HorizontalStackLayout>

        <Label Text="This app is written in XAML and C# with .NET MAUI by Jesse Liberty and Rodrigo Juarez. Concept and original design by Robin Liberty" />
    </VerticalStackLayout>
</ContentPage>

We put a picture of a forget-me-not flower next to the title. Below that is the version and the acknowledgements. We’ll want to be able to navigate to the About page using a tab at the bottom of the page, so let’s turn to AppShell.xaml and ad the tab there:

<TabBar>
    <ShellContent
        Title="Home"
        ContentTemplate="{DataTemplate local:MainPage}"
        Icon="icon_notes" />

    <ShellContent
        Title="About"
        ContentTemplate="{DataTemplate local:About}"
        Icon="icon_about" />

Next we open AppShell.xaml.cs and add the route

public AppShell()
{
	InitializeComponent();


    Routing.RegisterRoute("about", typeof(About));

}

That’s it! We created the page, created the tab and told MAUI where to find the page by registering the route.

Unknown's avatar

About Jesse Liberty

** Note ** Jesse is currently looking for a new position. You can learn more about him at https://jesseliberty.bio Thank you. Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen online courses. His latest book, Building APIs with .NET, is now available wherever you buy your books. Liberty was a Team Lead and Senior Software Engineer for various corporations, a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a 13 year Microsoft MVP.
This entry was posted in Essentials. Bookmark the permalink.

14 Responses to .NET MAUI – Forget Me Not – Part 2

  1. circus circus casino

    References:
    itkvariat.com

  2. Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://www.binance.com/join?ref=QCGZMHR6

  3. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? https://accounts.binance.info/ar/register-person?ref=FIHEGIZ8

  4. I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article. https://www.binance.info/uk-UA/register?ref=XZNNWTW7

  5. Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://accounts.binance.info/es-AR/register-person?ref=UT2YTZSU

  6. Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  7. Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://www.gate.io/share/XwNAUwgM

  8. I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  9. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  10. binance's avatar binance says:

    Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  11. Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  12. Your article helped me a lot, is there any more related content? Thanks!

  13. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  14. I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

Leave a Reply

Your email address will not be published. Required fields are marked *