<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"                    
             x:Class="inutralia.Views.ListDelSuper"
             x:Name="listDelSuper"
             Title="  TU   COMPRA   DELSUPER" >

    <StackLayout Margin="10,10" VerticalOptions="FillAndExpand" IsVisible="{Binding isBusy}">

        <ListView ItemsSource="{Binding ShoppingList}"
                  ItemTapped="ItemTapped"                        
                  IsPullToRefreshEnabled="True"
                  RefreshCommand="{Binding RefreshShoppingListCommand}"
                  IsRefreshing="{Binding IsBusy, Mode=OneWay}"           
                  BackgroundColor="Transparent"
                  CachingStrategy="RecycleElement"
                  SeparatorColor="{DynamicResource AccentColor}"
                  Footer=""
                  HasUnevenRows="False"
                  x:Name="ListView">

            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <ContentView VerticalOptions="FillAndExpand"  HorizontalOptions="FillAndExpand" >
                            <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" Padding="10,10,10,10" >
                                <Label Text="{Binding Text}" HorizontalOptions="StartAndExpand" FontSize="Medium"/>
                            </StackLayout>
                        </ContentView>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

        <StackLayout Orientation="Horizontal"  HorizontalOptions="FillAndExpand" Padding="0,10,0,10" >
            <artina:Button x:Name="buyModalButton" 
                           Text="DELSUPER"
                           FontSize="Medium"
                           HorizontalOptions="FillAndExpand"
                           VerticalOptions="Center"
                           HeightRequest="60"
                           WidthRequest="120"
                           Clicked="BuyModalButton"                                 
                           Style="{DynamicResource PrimaryActionButtonStyle}" 
                           BackgroundColor="#3b5998"/>

            <artina:Button x:Name="cancelModalButton" 
                           Text="Cancelar"
                           FontSize="Medium"
                           HorizontalOptions="FillAndExpand"
                           VerticalOptions="Center"
                           HeightRequest="60"
                           WidthRequest="110"
                           Clicked="CancelModalButton"                               
                           Style="{DynamicResource DeleteButtonStyle}"/>
        </StackLayout>
    </StackLayout>
</ContentPage>
