Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Xamarin.UWP CarouselPage OnAppearing() bug #15577

Open
jessiezh0320 opened this issue Oct 24, 2022 · 0 comments
Open

[Bug] Xamarin.UWP CarouselPage OnAppearing() bug #15577

jessiezh0320 opened this issue Oct 24, 2022 · 0 comments
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@jessiezh0320
Copy link

jessiezh0320 commented Oct 24, 2022

Set "Current Page" to not the first page, why do dialog in other pages also pop up?

Steps to Reproduce

  1. Create a blank xamarin form demo .
  2. Create a page Home which extends CarouselPage :

Home.xaml.cs

public partial class Home : CarouselPage 
    {
        public Home()
        {
            Children.Insert(0, new CarPage1());
            Children.Insert(1, new CarPage2());
            Children.Insert(2, new CarPage3());
            CurrentPage = Children[1];

            InitializeComponent();
        }
    }

Home.xaml

<?xml version="1.0" encoding="utf-8" ?> 
<CarouselPage  xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="UwpApp1024.Home">

</CarouselPage>

3.Create three Contentpage (CarPage1, CarPage2 and CarPage3) and add the following functions:

CarPage1.xaml.cs

    public partial class CarPage1 : ContentPage 
    {
        public CarPage1()
        {
            InitializeComponent();
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            DisplayAlert("Page1", null, "ok");
        }
    }

CarPage2.xaml.cs

    public partial class CarPage2 : ContentPage 
    {
        public CarPage2()
        {
            InitializeComponent();
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            DisplayAlert("Page2", null, "ok");
        }
    }

CarPage3.xaml.cs

    public partial class CarPage3 : ContentPage 
    {
        public CarPage3()
        {
            InitializeComponent();
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            DisplayAlert("Page3", null, "ok");
        }
    }
  1. modify the following code in App.xaml.cs:

      MainPage = new NavigationPage(new Home());
    

5.Deploy the app to uwp, you could find that Page2 alert show, then click ok, why Page1 alert show?

Expected Behavior

After Page2 alert show, then click ok button, the Page2 could display normally.
And above code works on android.

Actual Behavior

@jessiezh0320 jessiezh0320 added s/unverified New report that has yet to be verified t/bug 🐛 labels Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants
@jessiezh0320 and others