Skip to content

ActiveAware is called more than needed #2816

@muak

Description

@muak

When NavigationSegments is "/TabbedPage/NavigationPage/ContentPage",
ActiveAware method is called twice in ContentPage's ViewModel implemented IActiveAware.
This problem only occurs when the application is launched.

.OnAppStart((container,navigationService) =>
{
    navigationService.CreateBuilder()
    .AddTabbedSegment("MyTabbedPage", config =>
    {
        config
        .CreateTab(t => t.AddSegment<MyNavigationViewModel>().AddSegment<MainViewModel>())
    })
    .Navigate(HandleNavigationError);
})

The cause of this is the duplication of IsActive operations in the NavigationPageActiveAwareBehavior and the TabbedPageActiveAwareBehavior.

Perhaps this can be resolved by adapting the NavigatingPageActiveAwareBehavior after adding a child to the TabbedPage.
I think it can also be solved by applying TabbedPageActiveAwareBehavior after adding children to TappedPage.

Currently, behaviors are applied in the CreatePage method, so adding a CreatePage method that does not apply Behaviors may be a solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions