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

StackLayouts with excluding IsVisible properties

$
0
0

Hello,

I am trying to write a ListView in which the cells vary their layout depending on some bool properties of the binded object. For example, the object has:
bool isTypeA = false;
bool isTypeB = true;
bool isTypeC = false;
bool isTypeD = false;

So i put inside the ViewCell four different StackLayouts each with:
<StackLayout
IsVisible={Binding isTypeA}
......
<StackLayout
IsVisible={Binding isTypeB}
......
<StackLayout
IsVisible={Binding isTypeC}
......
<StackLayout
IsVisible={Binding isTypeD}
......

With this i want to appear just one of them. The problem is, only the last of the StackLayouts appear. If isTypeA, isTypeB and isTypeC are false and isTypeD is true, the forth (TypeD) StackLayout appears. But if isTypeA, isTypeB and isTypeD are false and isTypeC is true, nothing appears. Just blank space.

Could someone please explain me why is this happening?

Thank you in advance


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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