-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Shell query parameter not being set before OnAppearing of page is called #11549
Comments
Will this issue be fixed in 5.0.0? |
I tested in Xamarin.Forms 4.6.x , 4.8.x same issue |
@samhouts Does this mean that this issue will no longer be fixed? |
With 4.8.0.1687 I have the same issue, but the actual behavior happens only if I navigate to the page for the first time, any subsequent navigation works as expected. If I have a similar page to track constructor, query property and OnAppearing call order [QueryProperty(nameof(QueryData), nameof(QueryData))]
public partial class ShellPage : ContentPage
{
private readonly ShellPageViewModel viewModel;
public string QueryData
{
set
{
Trace.WriteLine("ShellPage.QueryData setter");
viewModel.QueryData = value;
}
}
public ShellPage()
{
Trace.WriteLine("ShellPage ctor");
InitializeComponent();
BindingContext = viewModel = new ShellPageViewModel();
}
protected override void OnAppearing()
{
Trace.WriteLine("ShellPage.OnAppearing");
base.OnAppearing();
}
} Navigating to the page for the first time outputs
Any subsequent navigation outputs
As mentioned, the order must be consistent for any given navigation. |
I am having same Issue with 5.0.0.2012 |
I have also had this problem for some time. protected async override void OnAppearing()
{
base.OnAppearing();
await Task.Yield();
//DO some stuff with QueryProperty populated
} |
I am having same problem 5.0.0.2478 |
@PureWeen Hello? This is still a problem in MAUI 7.0.81. It works (ApplyQueryAttributes called before OnAppearing) either only first time or never (it's not determistic). |
Still an issue with MAUI. The first time the page loads the query properties are not populated when the OnAppearing is fired. |
Is there an issue on the MAUI repository for this? |
Yes, I just noticed this happens sometimes for me 30% of the time OnAppearing gets called before ApplyQueryAttributes. |
Should it be so that it is solved? Shell is for both MAUI and Xamarin or does it differ? |
Is there Maui bug for this out there? |
Description
Shell page parameter navigation does not set parameter for page before OnAppearing is called. In prior releases, the OnAppearing used to be called after the paramters were set allowing us to load the content based on the parameter.
Steps to Reproduce
Expected Behavior
The parameter set should be called before the OnAppearing is called
Actual Behavior
OnAppearing of page 2 is called before the id parameter is set
Basic Information
The text was updated successfully, but these errors were encountered: