Amaro Manungu

Amaro Manungu

  • NA
  • 33
  • 1.2k

How to make visible/in the button inside a listview

Sep 14 2018 10:00 AM
I have a listview and inside it I have a label and a button, when the state of the label is paid the button should be visivil and when it is canceled the button should be invisi
<StackLayout Grid.Row="2" Margin="40,40,40,0">

<ListView x:Name="lstView" SeparatorColor="#1C97D5" SeparatorVisibility="Default" HasUnevenRows="True" VerticalOptions="FillAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell StyleId="disclosure">
<StackLayout>
<StackLayout Orientation="Horizontal" >
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<StackLayout>
<Label Text="{Binding entityName}" TextColor="White" Font="14"/>
<Label Text="{Binding cmPaymentDate}" TextColor="White" Font="14"/>
<Label Text="{Binding statusDescr}" TextColor="White" Font="14"/>
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand">
<Button Text="Abrir" IsVisible="{Binding IsVisible}" BackgroundColor="#1C97D5"></Button>
<Label Text="{Binding paymentAmount}" TextColor="White" Font="14" HorizontalOptions="End" />
</StackLayout>
</StackLayout>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
 

Answers (3)