Hello the Xamarin community,
Today I encounter a strange issue with Xamarin.Forms and the Android platform. This code:
public static readonly BindableProperty IsHiddenProperty = BindableProperty.CreateAttached("IsHidden", typeof(bool), typeof(View), false, propertyChanged: IsHiddenChanged);
static void IsHiddenChanged(BindableObject bindable, object oldValue, object newValue)
{
Console.WriteLine("1. (bindable as View).IsVisible = " + (bindable as View).IsVisible);
(bindable as View).IsVisible = true;
Console.WriteLine("2. (bindable as View).IsVisible = " + (bindable as View).IsVisible);
}
Gives:
// 1. (bindable as View).IsVisible = False
// 2. (bindable as View).IsVisible = False
This bug is only on Android. On iOS the result is good:
// 1. (bindable as View).IsVisible = False
// 2. (bindable as View).IsVisible = True
I tried to run the property update on the UI thread without any improvement.
Does someone have any idea ?
Florian.