xamarin/Xamarin.Forms

[Bug] Shell UWP ContentPage SizeChanged called only once

Aperta

#8501 aperta il 14 nov 2019

 (2 commenti) (2 reazioni) (0 assegnatari)C# (1926 fork)batch import
e/4 :clock4:help wantedinactivep/UWPt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Description

If you have a ContentPage, add the event SizeChanged, on iOS its called when the size is changed but it is only called once with UWP, resize the page and it is not called again.

Steps to Reproduce

  1. Xamarin.Forms 4.3 with Shell on UWP. Using the simple created project from the iOS/Android add in the UWP project.

  2. in the views folder of your project change the items page to be like the following

  3. public ItemsPage() { InitializeComponent();

         BindingContext = viewModel = new ItemsViewModel();
    
         **SizeChanged += ItemsPage_SizeChanged;**
     }
    
     **private void ItemsPage_SizeChanged(object sender, EventArgs e)
     {
         Debug.WriteLine("SizeChanged Called");
     }**
    
  4. Run the project in UWP mode, in the output window you should see the SizeChanged called message, when you resize the UWP screen you should see it again and again.

Expected Behavior

The event SizeChanged should be called when the window is resized

Actual Behavior

UWP - it is not being called after the initial call

Guida contributor