Bug 34597 - TabbedPage UI Updates do not occur
Summary: TabbedPage UI Updates do not occur
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.5.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-10-06 14:04 UTC by Julien
Modified: 2016-04-13 18:07 UTC (History)
5 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Julien 2015-10-06 14:04:13 UTC
Create a new Xamarin.Forms app.

Create a new ContentPage, and set this is as the MainPage.

MainPage = new NavigationPage(new TestSwitchCell.MainPage());

On the MainPage, add a button that loads a TabbedPage.

		private async void LoadPage ()
		{
			await Navigation.PushAsync(new MyTabbedPage());
                }

Have this tabbed page add a child that contains some SwitchCells bound to some ViewModel bools.

Toggle the bools in code behind, and see how the SwitchCells on the UI do not toggle.

If you remove the ContentPage from the test, and make this TabbedPage the root MainPage, it all of a sudden works again.
Comment 1 Julien 2015-10-06 14:06:46 UTC
I am testing against Android, do not have access to iOS.
Comment 2 David Strickland 2015-10-06 17:51:29 UTC
Did a bit of chasing on this one and below is the code to reproduce it.

The switch cell does get the initial value and the Button does stay wired to is handler. Clicking the button updates the underlying property but does not then populate up to the screen.
TextCell Is likewise effected getting the initial value for its Text but not populating thereafter.

This error does not occur if you use PushModalAsync instead of PushAsync.


<!--Start App.cs-->
using System;using Xamarin.Forms;using System.Windows.Input;

namespace SwitchCellInTabbedPage
{
public class App : Application
{
public App ()
{
 var myButton = new Button(){Text="Test"};

 myButton.Clicked += (sender, e) => {
 MainPage= new NavigationPage(new ContentPage());
 MainPage.Navigation.PushAsync (birthTheProblemChild());
 };
 MainPage = new NavigationPage (new ContentPage(){Content=myButton});
}
TabbedPage birthTheProblemChild ()
{
 SwitchCell mySwitch = new SwitchCell ();
 mySwitch.SetBinding (SwitchCell.OnProperty, "IsToggled", 0);
 return new TabbedPage () {Children = {new ContentPage {
  BindingContext = this,
  Content = new StackLayout {
  Children = {
  new Button () {Text = "test",Command = new Command (() => IsToggled = !IsToggled)},
  new TableView {	Intent = TableIntent.Form,Root = new TableRoot {new TableSection {mySwitch}	} }	} }	} }	};
}
private bool isToggled;
public bool IsToggled
{
 get{return isToggled;}
 set{isToggled = value;
 OnPropertyChanged("IsToggled");
}}}}
Comment 3 Samantha Houts [MSFT] 2016-02-09 01:39:03 UTC
I've confirmed that this behavior is not present if you use AppCompat/Material in your application. Is that an option for you at this time? 

Thank you!
Comment 4 Jason Smith [MSFT] 2016-04-13 18:07:02 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team