G9MAUIControls.Barcode 1.4.12

dotnet add package G9MAUIControls.Barcode --version 1.4.12
                    
NuGet\Install-Package G9MAUIControls.Barcode -Version 1.4.12
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="G9MAUIControls.Barcode" Version="1.4.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="G9MAUIControls.Barcode" Version="1.4.12" />
                    
Directory.Packages.props
<PackageReference Include="G9MAUIControls.Barcode" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add G9MAUIControls.Barcode --version 1.4.12
                    
#r "nuget: G9MAUIControls.Barcode, 1.4.12"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package G9MAUIControls.Barcode@1.4.12
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=G9MAUIControls.Barcode&version=1.4.12
                    
Install as a Cake Addin
#tool nuget:?package=G9MAUIControls.Barcode&version=1.4.12
                    
Install as a Cake Tool

G9MAUIControls.Barcode

Barcode entry field with scan state and format validation, for G9MAUIControls.

dotnet add package G9MAUIControls.Barcode

What it adds

G9BarcodeTextEntry — an outlined text field with an integrated scan affordance. It extends the core's G9TextEntry, so it inherits the whole outlined-field architecture (painted outline, floating label, icon slots, RTL column swapping) and adds:

  • a trailing scan button that raises ScanRequested so you can open your scanner;
  • trailing state feedback — idle glyph → spinner while scanning → accepted tick → error glyph — using the core's cached-icon-host contract, so a state change never flashes a tofu box;
  • optional format validation, so a scan that does not match is rejected at the field rather than downstream;
  • a multi-scan session mode for entering many codes in a row without reopening the scanner.

Why this is a separate package

Barcode entry is a scanning workflow, not a text field: a scan-state machine, an accept/reject rule, and a multi-scan session are opinions about a task, so they stay out of the core's general-purpose input surface. Keeping it separate also lets it version independently of the 25 core controls.

What it deliberately does NOT do: drive a camera. See "Usage" — the control raises ScanRequested and you supply the scanner, which means this package never dictates which camera library your app uses.

Platform setup

These are what your scanner will need. Nothing here is required by this package's own code; it is here because every consumer of this control ends up needing it.

Android — AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false" />

required="false" matters: a hard requirement makes your app uninstallable on camera-less devices.

iOS — Info.plist:

<key>NSCameraUsageDescription</key>
<string>Scan barcodes to enter codes without typing them.</string>

Write a real reason. App review rejects placeholder text, and the string is shown to the user verbatim.

Windows / Mac Catalyst — nothing. The scanner reference is Android/iOS-only and these platforms compile against a no-op provider, so the scan button is hidden rather than offering a control that cannot work.

Usage

You own the camera; the control owns the field. G9BarcodeTextEntry does not open a scanner itself — it raises ScanRequested when the user taps its trailing scanner icon, and you show whatever scanner you already use. Feed results back with StartScan() / StopScan() and let the control validate them. That split is deliberate: a control that owned the camera would dictate which scanner package your app uses.

<barcode:G9BarcodeTextEntry
    x:Name="CodeEntry"
    Label="Sample code"
    Text="{Binding Code}"
    AcceptedCodeRegex="^\d{3}/\d{3}/\d{6}$"
    ScanMode="Multiple" />
// User tapped the scanner icon — open your scanner.
CodeEntry.ScanRequested += async (_, _) =>
{
    CodeEntry.StartScan();                    // trailing slot becomes a spinner
    try
    {
        var code = await myScanner.ScanOnceAsync();
        CodeEntry.Text = code;                // rejected silently if AcceptedCodeRegex doesn't match
    }
    finally
    {
        CodeEntry.StopScan();                 // always — otherwise the field stays busy
    }
};

// A code passed AcceptedCodeRegex.
CodeEntry.Accepted += (_, code) => viewModel.Add(code);

ScanMode.Single returns to Idle after one accepted code; ScanMode.Multiple stays armed so an operator can enter many codes without reopening the scanner. ScanState is a G9BarcodeTextEntryState — Idle / ScanBusy / Accepted / Error — and drives the field's chrome, so you can also drive it directly instead of using StartScan / StopScan.

Requirements

.NET 10 · net10.0-android, net10.0-ios, net10.0-maccatalyst, net10.0-windows10.0.19041.0

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst26.0 is compatible.  net10.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.12 96 11/16/2026
1.4.11 102 11/10/2026
1.4.10 105 11/9/2026
1.4.9 100 11/9/2026
1.4.8 103 11/8/2026
1.4.7 117 11/4/2026
1.4.6 112 11/3/2026
1.4.5 109 11/2/2026
1.4.4 109 11/2/2026
1.4.3 119 10/21/2026
1.4.2 111 10/13/2026
1.4.1 107 10/13/2026
1.4.0 117 10/5/2026
1.3.0 120 10/3/2026
1.2.0 122 9/27/2026
1.1.0 126 9/21/2026
1.0.14 136 9/12/2026
1.0.13 133 9/8/2026
1.0.12 132 9/8/2026
1.0.10 146 9/7/2026
Loading failed

1.4.12
       - A close-top (or the hardware back) during a stacked sheet's stage-before-show hold closes THAT sheet, not the one under it; a staged sheet counts as the top.
       - An empty or blank label no longer hides an outlined field's placeholder.