Itp.WpfScanners 2.0.7

dotnet add package Itp.WpfScanners --version 2.0.7
NuGet\Install-Package Itp.WpfScanners -Version 2.0.7
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="Itp.WpfScanners" Version="2.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Itp.WpfScanners --version 2.0.7
#r "nuget: Itp.WpfScanners, 2.0.7"
#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.
// Install Itp.WpfScanners as a Cake Addin
#addin nuget:?package=Itp.WpfScanners&version=2.0.7

// Install Itp.WpfScanners as a Cake Tool
#tool nuget:?package=Itp.WpfScanners&version=2.0.7

ITP WPF Barcode Scanner API

Keyboard-like incorporation of barcode scanners into WPF applications. Support for Serial and HID barcode scanners.

ScannerScopes are a container element which handles scans which occur when focus is within the scope.

Scanner scopes connect to a parent ScannerControlScope, which "owns" the scanner and interacts with hardware.

When focus is outside of any ScannerScopes, the scanner is disabled or ceded to other applications

Example use

<Window x:Class="Itp.WpfScanners.TestClient.ScannerTestWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:cscan="urn:itp:scanners"
        Title="ScannerTestWindow" Height="300" Width="300">
    <cscan:ScannerControlScope AutoConfigure="True">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>

            <TextBox Text="This side of the form is not scanner enabled" />
            <GroupBox Header="This side is enabled" Grid.Column="1">
                <cscan:ScannerScope x:Name="scope1" ScanReceived="scope1_ScanReceived">
                    <StackPanel Orientation="Vertical">
                        <TextBox x:Name="tbS1" Text="This is attached to the outside" />
                            <GroupBox Header="still enabled">
                            <cscan:ScannerScope x:Name="scope2" ScanReceived="scope2_ScanReceived">
                                <StackPanel Orientation="Vertical">
                                    <Button Content="this is on the inside" x:Name="btS2" />
                                </StackPanel>
                            </cscan:ScannerScope>
                        </GroupBox>
                    </StackPanel>
                </cscan:ScannerScope>
            </GroupBox>
        </Grid>
    </cscan:ScannerControlScope>
</Window>

Codebehind:

using System.Windows;

namespace Itp.WpfScanners.TestClient
{
    public partial class ScannerTestWindow : Window
    {
        public ScannerTestWindow()
        {
            InitializeComponent();
        }

        private void scope1_ScanReceived(object? sender, ScannedDataEventArgs args)
        {
            tbS1.Text = args.TextData;
            args.IsHandled = true;
        }

        private void scope2_ScanReceived(object? sender, ScannedDataEventArgs args)
        {
            btS2.Content = args.TextData;
            args.IsHandled = true;
        }
    }
}

Known issues

Product Compatible and additional computed target framework versions.
.NET net7.0-windows10.0.22621 is compatible.  net8.0-windows was computed. 
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
2.0.7 127 8/23/2023
2.0.6 111 5/16/2023
2.0.5 103 5/16/2023
2.0.4 127 4/30/2023
2.0.3 134 4/22/2023
2.0.2 136 4/22/2023