Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

IsVisible doesn't allow to be updated in propertyChanged

$
0
0

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.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>