0

I got 2 pages FirstPage which is Content and SecondPage which is Tabbed page FirstPage contains OnAppearing method

protected override void OnAppearing()
    {
        if (Preferences.Get("IsLogged", false) == true && App.BugFix == true)
        {
            Task.Run(async () =>
            {
                await Navigation.PushModalAsync(new MainTabPage());
            });
        }
    }

When the conditions is true it navigated to the TabPage ( for example it has 3 children pages), but i can see first children(page) and there is no ToolBar image how it should look

I changed this part of code

Task.Run(async () =>
            {
                await Navigation.PushModalAsync(new MainTabPage());
            });

to

Dispatcher.Dispatch(async () =>
            {
                await Navigation.PushModalAsync(new MainTabPage());
            });

and now it works as expected, but it has visual problem, before it navigates to the tab page it shows the FirstPage for like a second.

5
  • Why is your TabbedPage a ModalPage?
    – FreakyAli
    Commented Aug 4, 2023 at 13:24
  • I don't really get you. Is it because i push it modalAsync?
    – Natan
    Commented Aug 4, 2023 at 13:45
  • Do you know what a modal page does is the question...
    – FreakyAli
    Commented Aug 4, 2023 at 14:51
  • From what i know, Any page can be modal. A page becomes modal when we push it on modal stack and it becomes active also user cannot navigate back from modal page till a task is completed or cancelled and we don't have nav bar. Oh i probably got you. Now the Task.Run works fine. Ty
    – Natan
    Commented Aug 4, 2023 at 17:23
  • 1
    I recommend adding Your Answer below, showing how you solved it. This may help others in the future. Commented Aug 4, 2023 at 18:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.