Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Navigating to a Shell Page and Performing Async Operations in ShellContent #63

Open
exendahal opened this issue Jul 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@exendahal
Copy link

I have a Shell Page with several ShellContent items. Here is the code for the Shell Page:

<TabBar>
    <Tab Title="Explore">
        <Tab.Icon>
            <FontImageSource FontFamily="MaterialIcon" Glyph="&#xf56e;" />
        </Tab.Icon>
        <ShellContent ContentTemplate="{DataTemplate views:HomePageView}" />
    </Tab>
    <Tab Title="Cart">
        <Tab.Icon>
            <FontImageSource FontFamily="MaterialIcon" Glyph="&#xf110;" />
        </Tab.Icon>
        <ShellContent ContentTemplate="{DataTemplate views:CartView}" />
    </Tab>
    <Tab Title="Account">
        <Tab.Icon>
            <FontImageSource FontFamily="MaterialIcon" Glyph="&#xf004;" />
        </Tab.Icon>
        <ShellContent ContentTemplate="{DataTemplate views:ProfileView}" />
    </Tab>
</TabBar>

To navigate to the Shell Page, I use the following method:

 await navigationService.Push<AppShell>();

Requirement:

I need to perform some asynchronous operations in the OnNavigatedTo() method of each ShellContent. How can I achieve this functionality?

@exendahal exendahal added the enhancement New feature or request label Jul 7, 2024
@BurkusCat
Copy link
Owner

My initial gut feel is that you shouldn't be using Shell at all with Burkus.Mvvm.Maui. This library should be used instead of Shell. So I think in your case you'd want to use a TabbedPage (instead of a TabBar) like so: https://github.com/BurkusCat/Burkus.Mvvm.Maui/blob/main/samples/DemoApp/Views/Tabs/DemoTabsPage.xaml

Are you able to try the sample app the in the repo (https://github.com/BurkusCat/Burkus.Mvvm.Maui?tab=readme-ov-file#documentation-) to see if it does what you what it to do when it comes to tabs?

@BurkusCat BurkusCat added question Further information is requested and removed question Further information is requested labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants