c# – Xamarin.Kinds Shell GoToAsync is just not working as anticipated in iOS

0
13
c# – Xamarin.Kinds Shell GoToAsync is just not working as anticipated in iOS


I’m utilizing the Xamarin.Kinds – Shell function.
I must navigate from one tab (root) to a different tab (second degree).
The instance has three pages, for simplicity I named Page1, Page2, and Page3. Page1 and Page2 are essential tabs for the App Shell, the Web page 3 is a second degree of Page1 (stack).

The following code is a part of AppShell.xaml:

  <FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
     <ShellContent Route="page1" Title="Page1" ContentTemplate="{DataTemplate native:Page1}" />
     <ShellContent Route="page2" Title="Page2" ContentTemplate="{DataTemplate native:Page2}" />
</FlyoutItem>

The constructor in AppShell.cs is

 public AppShell()
        {
            InitializeComponent();
            Routing.RegisterRoute(nameof(Page3), typeof(Page3));
        }

Web page 1 and Web page 3 are ver related, simply to characterize two pages. The following is Page1.xaml

<?xml model="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/types"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="TestGoTo.Views.Page1"
              Title="Page1" BackgroundColor="LightGreen">
    <ContentPage.Content material>
        <StackLayout>
            <Label Textual content="Welcome to Page1"
                VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand" />
        </StackLayout>
    </ContentPage.Content material>
</ContentPage>

Page2.xaml features a button to name the GoToAsync perform

<?xml model="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/types"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="TestGoTo.Views.Page2"
             Title="Page2" BackgroundColor="LightYellow">
    <ContentPage.Content material>
        <StackLayout>
            <Label Textual content="Page2" HorizontalOptions="CenterAndExpand" />
            <Button Textual content="GoTo" Clicked="Button_Clicked"></Button>
        </StackLayout>
    </ContentPage.Content material>
</ContentPage>

Page2.cs – Button Motion is

non-public async void Button_Clicked(object sender, EventArgs e)
        {
             await Shell.Present.GoToAsync($"//page1/{nameof(Page3)}");
        }

The Drawback:

If you go the Page2 and click on the button, the anticipated conduct is to indicate the web page 3 beneath tab of web page 1, however you stay within the tab/page2. If you happen to go (manually) to web page 1 you will note the stack with the web page 3. So, the web page 3 is in the precise place (loaded), however you didn’t see it since you stay within the web page 2.

This downside is introduced solely in iOS, Android works as anticipated.

What’s improper right here?
Is there a Bug in Xamarin.Kinds (Shell for iOS)?

Your assistance is appreciated.

LEAVE A REPLY

Please enter your comment!
Please enter your name here