Using tabs to execute commands

Kenneth Roy 20 Reputation points
2023-09-11T16:21:33.02+00:00

Tabs seemed to be used for navigation from page to page. But instead of moving to a page can it execute some command similar to a button. For example, I would like to have my pages have a common "toolbar" on each page which has a Clear, Save and Cancel buttons. But have these buttons be the tab items??

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

Accepted answer
  1. Leo Wagner de Souza 691 Reputation points
    2023-09-11T16:53:41.7133333+00:00

    Hello @Kenneth Roy !

    The tabs are used for navigation, like you just noted.

    What you are looking for is called "toolbar" in MAUI, and you can check how to implement it here:

    https://learn.microsoft.com/en-us/dotnet/maui/user-interface/toolbaritem

    If you need something more flexible, you can mimic a toolbar using radio buttons, like here:
    https://dev.to/davidortinau/making-a-tabbar-or-segmentedcontrol-in-net-maui-54ha

    You can also add personalized buttons to your tabs, like here:
    https://vladislavantonyuk.github.io/articles/Adding-custom-action-button-to-.NET-MAUI-Shell-TabBar/

    Finally, you can encapsulate this controls in a template, that can be used on other pages of your app.

    If this answer helped you, please accept it as correct.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.