<?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"
             x:Class="Sample.MainPage">

    <ScrollView AbsoluteLayout.LayoutFlags="All" 
                AbsoluteLayout.LayoutBounds="0,0,1,1">
        <Grid Padding="5"
              RowSpacing="15">
            <Grid.RowDefinitions>
                <!--Row #1 : Connection Type and Search Button-->
                <RowDefinition Height="Auto"/>
                <!--Row #2 : Selected Device-->
                <RowDefinition Height="Auto"/>
                <!--Row #3 : Device Model-->
                <RowDefinition Height="Auto"/>
                <!--Row #4 : Enable Callback Function Switch-->
                <RowDefinition Height="Auto"/>
                <!--Row #5 : Connect and Disconnect Button-->
                <RowDefinition Height="Auto"/>
                <!--Row #6 : Sample Buttons-->
                <RowDefinition Height="Auto"/>
                <!--Row #7 : Printer Status and Barcode Scanner Status-->
                <RowDefinition Height="Auto"/>
                <!--Row #8 : Scanned Barcode Data-->
                <RowDefinition Height="Auto"/>
                <!--Row #9 : Version-->
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <!--Row #1 : Connection Type and Search Button-->
            <StackLayout Grid.Row="0" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="4"
                         Spacing="0">
                <Label 
                       TextColor="#1976D2"
                       Text="Connection Type"/>
                <Picker x:Name="SearchTypePicker"
                            TextColor="{AppThemeBinding Light=Black, Dark=White}">
                    <Picker.Items>
                        <x:String>Bluetooth</x:String>
                        <x:String>TCP/IP</x:String>
                        <x:String>USB</x:String>
                    </Picker.Items>
                    <Picker.SelectedIndex>0</Picker.SelectedIndex>
                </Picker>
            </StackLayout>
            <Button Grid.Row="0" 
                    Grid.RowSpan="1" 
                    Grid.Column="4" 
                    Grid.ColumnSpan="2"
                    x:Name="SearchButton"
                    Text="Search"
                    Clicked="SearchButton_Clicked"/>

            <!--Row #2 : Selected Device-->
            <StackLayout Grid.Row="1" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="6"
                         Spacing="0">
                <Label 
                       TextColor="#1976D2"
                       Text="Selected Device"/>
                <Frame BorderColor="Gainsboro"
                       BackgroundColor="WhiteSmoke"
                       HasShadow="False"
                       Padding="10">
                    <Label x:Name="SelectedDeviceLabel"
                           FontSize="16"
                           TextColor="Gray"
                           Text="Device is not selected."/>
                </Frame>
            </StackLayout>

            <!--Row #3 : Device Model-->
            <StackLayout Grid.Row="2" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="6"
                         Spacing="0">
                <Label 
                       TextColor="#1976D2"
                       Text="Device Model"/>
                <Picker x:Name="DeviceModelPicker"
                        TextColor="{AppThemeBinding Light=Black, Dark=White}">
                    <Picker.Items>
                        <x:String>MP-B21L</x:String>
                        <x:String>SLP720RT</x:String>
                        <x:String>MP-B30L</x:String>
                        <x:String>RP-F10/G10</x:String>
                        <x:String>MP-B30</x:String>
                        <x:String>MP-B20</x:String>
                        <x:String>RP-E10</x:String>
                        <x:String>RP-D10</x:String>
                        <x:String>DSP-A01</x:String>
                        <x:String>MP-A40</x:String>
                    </Picker.Items>
                    <Picker.SelectedIndex>0</Picker.SelectedIndex>
                </Picker>
            </StackLayout>

            <!--Row #4 : Enable Callback Function Switch-->
            <StackLayout Grid.Row="3" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="6"
                         Spacing="0">
                <Label 
                       TextColor="#1976D2"
                       Text="Enable Callback Function When Connecting"/>
                <Switch x:Name="CallbackSwitch"
                        IsToggled="True"
                        VerticalOptions="Center"
                        HorizontalOptions="Start"/>
            </StackLayout>

            <!--Row #5 : Connect and Disconnect Button-->
            <Button Grid.Row="4" 
                    Grid.RowSpan="1" 
                    Grid.Column="0" 
                    Grid.ColumnSpan="3"
                    Margin="0,0,3,0"
                    x:Name="ConnectButton"
                    Text="Connect"
                    Clicked="ConnectButton_Clicked"/>
            <Button Grid.Row="4" 
                    Grid.RowSpan="1" 
                    Grid.Column="3" 
                    Grid.ColumnSpan="3"
                    Margin="3,0,0,0"
                    x:Name="DisconnectButton"
                    Text="Disconnect"
                    Clicked="DisconnectButton_Clicked"/>

            <!--Row #6 : Sample Buttons-->
            <StackLayout Grid.Row="5" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="6"
                         Spacing="10">
                <Button x:Name="StandardSampleButton"
                        Text="Standard Mode Sample"
                        Clicked="StandardSampleButton_Clicked"/>
                <Button x:Name="PageSampleButton"
                        Text="Page Mode Sample"
                        Clicked="PageSampleButton_Clicked"/>
                <Button x:Name="SmartLabelSampleButton"
                        Text="Smart Label Sample"
                        Clicked="SmartLabelSampleButton_Clicked"/>
                <Button x:Name="DisplaySampleButton"
                        Text="Display Sample"
                        Clicked="DisplaySampleButton_Clicked"/>
                <Button x:Name="SendDataFileSampleButton"
                        Text="Send Data File"
                        Clicked="SendDataFileSampleButton_Clicked"/>
                <Button x:Name="PrintPDFSampleButton"
                        Text="Print PDF"
                        Clicked="PrintPDFSampleButton_Clicked"/>
                <Button x:Name="OpenDrawerSampleButton"
                        Text="Open Drawer"
                        Clicked="OpenDrawerSampleButton_Clicked"/>
            </StackLayout>

            <!--Row #7 : Printer Status and Barcode Scanner Status-->
            <StackLayout Grid.Row="6" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="3"
                         Spacing="0"
                         Margin="0,0,3,0">
                <Label 
                       LineBreakMode="TailTruncation"
                       TextColor="#1976D2"
                       Text="Printer Status"/>
                <Frame BorderColor="Gainsboro"
                       BackgroundColor="WhiteSmoke"
                       HasShadow="False"
                       Padding="10">
                    <Label x:Name="StatusLabel"
                           FontSize="16"
                           TextColor="Gray"
                           Text="-"/>
                </Frame>
            </StackLayout>
            <StackLayout Grid.Row="6" 
                         Grid.RowSpan="1" 
                         Grid.Column="3" 
                         Grid.ColumnSpan="3"
                         Spacing="0"
                         Margin="3,0,0,0">
                <Label 
                       LineBreakMode="TailTruncation"
                       TextColor="#1976D2"
                       Text="Barcode Scanner Status"/>
                <Frame BorderColor="Gainsboro"
                       BackgroundColor="WhiteSmoke"
                       HasShadow="False"
                       Padding="10">
                    <Label x:Name="ScannerStatusLabel"
                           FontSize="16"
                           TextColor="Gray"
                           Text="-"/>
                </Frame>
            </StackLayout>

            <!--Row #8 : Scanned Barcode Data-->
            <StackLayout Grid.Row="7" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="1"
                         Spacing="0">
                <Label 
                       TextColor="#1976D2"
                       Text="String"/>
                <Switch x:Name="EncodeSwitch"
                        IsToggled="True"
                        VerticalOptions="Center"
                        HorizontalOptions="Start"/>
            </StackLayout>
            <StackLayout Grid.Row="7" 
                         Grid.RowSpan="1" 
                         Grid.Column="1" 
                         Grid.ColumnSpan="5"
                         Spacing="0">
                <Label 
                       TextColor="#1976D2"
                       Text="Scanned Data"/>
                <Frame BorderColor="Gainsboro"
                       BackgroundColor="WhiteSmoke"
                       HasShadow="False"
                       Padding="10">
                    <Label x:Name="ScannedDataLabel"
                           FontSize="16"
                           TextColor="Gray"
                           Text="-"/>
                </Frame>
            </StackLayout>
            <!--Row #9 : Version-->
            <StackLayout Grid.Row="8" 
                         Grid.RowSpan="1" 
                         Grid.Column="0" 
                         Grid.ColumnSpan="6"
                         Spacing="0">
                <Label
                       x:Name="VersionLabel"
                       TextColor="#1976D2"
                       HorizontalOptions="End"
                       Text="Ver: x.x.x / x.x.x"/>
            </StackLayout>
        </Grid>
    </ScrollView>
</ContentPage>

