<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:controls="clr-namespace:AsReader251GMAUIiOSDemo"
             xmlns:local="clr-namespace:AsReader251GMAUIiOSDemo"
             x:Class="AsReader251GMAUIiOSDemo.RFIDInventoryPage"
             Title="RFIDInventoryPage">
        <Grid RowDefinitions="*" ColumnDefinitions="*" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">

    <StackLayout Grid.Row="0">
        <ListView x:Name="RFIDListView" HasUnevenRows="True" Margin="0, 0, 0, 0">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <controls:CustomCell Type="{Binding Type}" Barcode="{Binding Barcode}" Count="{Binding Count}"/>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <StackLayout Orientation="Horizontal" Margin="0, 10, 0, 0">
            <Label Text="Power Gain" TextColor="Black" FontSize="17" HorizontalOptions="Start" Margin="10, 10"/>
            <Picker x:Name="RescanTimePicker" FontSize="16" TitleColor="Black" HorizontalTextAlignment="Center" HorizontalOptions="EndAndExpand" Margin="10, 0, 10, 0" WidthRequest="100" SelectedIndexChanged="OnPickerSelectedIndexChanged">
            </Picker>
        </StackLayout>

        <StackLayout Orientation="Horizontal" Margin="0, 20, 0, 0">
            <Label Text="Count" TextColor="Black" FontSize="17" HorizontalOptions="Start" Margin="10, 0"/>
            <Label x:Name="CountLabel" Text="0" TextColor="#80007F" FontSize="30" FontAttributes="Bold" HorizontalOptions="EndAndExpand" Margin="0, -10, 10, 0" />
        </StackLayout>

        <StackLayout Orientation="Horizontal" Margin="0, 10, 0, 30">
            <Button x:Name="StartScanButton" InputTransparent="{Binding ShowMask}" Text="Inventory" TextColor="#2B6FF2" FontSize="17" TextTransform="None" BackgroundColor="#E1E1E1" Clicked="StartScanButton_Clicked" Padding="10,0,10,0" Margin="10, 0, 10, 0" HorizontalOptions="StartAndExpand" WidthRequest="140"/>
            <Button x:Name="ClearScanButton" Text="Clear" TextColor="#2B6FF2" FontSize="17" TextTransform="None" BackgroundColor="#E1E1E1" Clicked="ClearScanButton_Clicked" Padding="10,0,10,0"  Margin="10, 0, 10, 0" HorizontalOptions="EndAndExpand" WidthRequest="140"/>
        </StackLayout>
    </StackLayout>
    <BoxView Grid.Row="0" x:Name="boxview" IsVisible="{Binding ShowMask}" InputTransparent="False" Color="White" Opacity="0.6" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"/>
    <local:ActivityIndicatorView Grid.Row="0" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" IsVisible="{Binding ShowActivityIndicator}"/>
    </Grid>
</ContentPage>
