<?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"
             x:Class="AsReader251GMAUIiOSDemo.BarcodeScanPage"
             Title="BarcodeScanPage">
    <StackLayout>
        <ListView x:Name="BarcodeListView" HasUnevenRows="True">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <controls:CustomCell Type="{Binding Type}" Barcode="{Binding Barcode}" Count="{Binding Count}"/>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <StackLayout Orientation="Horizontal" Margin="0, 20, 0, 0">
            <Label Text="Encoding" TextColor="Black" FontSize="17" HorizontalOptions="Start" Margin="10, 0"/>
            <Button x:Name="ASCIIButton" Text="ASCII" TextColor="Black" FontSize="15" TextTransform="None" BackgroundColor="#E1E1E1" Clicked="ASCIIButton_Clicked" Margin="0, -10, 7, 5" HorizontalOptions="EndAndExpand" WidthRequest="70"/>
            <Button x:Name="UTF8Button" Text="UTF8" TextColor="Gray" FontSize="15" TextTransform="None" BackgroundColor="#E1E1E1" Clicked="UTF8Button_Clicked" Margin="0, -10, 7, 5" HorizontalOptions="EndAndExpand" WidthRequest="70"/>
            <Button x:Name="ShiftJISButton" Text="ShiftJIS" TextColor="Gray" FontSize="15" TextTransform="None" BackgroundColor="#E1E1E1" Clicked="ShiftJISButton_Clicked" Margin="0, -10,2, 5" HorizontalOptions="EndAndExpand" WidthRequest="75"/>
        </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="35" FontAttributes="Bold" HorizontalOptions="EndAndExpand" Margin="55, -10, 10, 0" />
        </StackLayout>


        <StackLayout Orientation="Horizontal" Margin="0, 10, 0, 30">
            <Button x:Name="StartScanButton" Text="Start Scan" TextColor="#2B6FF2" FontSize="17" TextTransform="None" BackgroundColor="#E1E1E1" Clicked="StartScanButton_Clicked" Padding="10,0,10,0" Margin="10, 0, 10, 0" HorizontalOptions="CenterAndExpand" WidthRequest="100"/>
            <Button x:Name="StopScanButton" Text="Stop Scan" TextColor="#2B6FF2" FontSize="17" TextTransform="None" BackgroundColor="#E1E1E1" Clicked="StopScanButton_Clicked" Padding="10,0,10,0" Margin="10, 0, 10, 0" HorizontalOptions="CenterAndExpand" WidthRequest="100"/>
            <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="CenterAndExpand" WidthRequest="100"/>
        </StackLayout>
    </StackLayout>
</ContentPage>