• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class BarcodeBase

This is the base class for all bar code type controls.

Inheritance
System.Object
BarcodeBase
MultiSectionBarcodeBase
SingleSectionBarcodeBase
Namespace: Telerik.Windows.Controls.Barcode
Assembly: Telerik.Windows.Controls.DataVisualization.dll

Syntax

[Obsolete("Use RadBarcode with the Code11 symbology. More info on upgrading at https://docs.telerik.com/devtools/wpf/controls/radbarcode/upgrading")]
public abstract class BarcodeBase : Control

Constructors

BarcodeBase()

Initializes a new instance of the BarcodeBase class.

Declaration
protected BarcodeBase()

Fields

RenderChecksumProperty

Identifies the RenderChecksum dependency property.

Declaration
public static readonly DependencyProperty RenderChecksumProperty
Field Value
System.Windows.DependencyProperty

RestrictAspectRatioProperty

Identifies the RestrictAspectRatio dependency property.

Declaration
public static readonly DependencyProperty RestrictAspectRatioProperty
Field Value
System.Windows.DependencyProperty

ShowChecksumProperty

Identifies the ShowChecksum dependency property.

Declaration
public static readonly DependencyProperty ShowChecksumProperty
Field Value
System.Windows.DependencyProperty

ShowTextProperty

Identifies the ShowText dependency property.

Declaration
public static readonly DependencyProperty ShowTextProperty
Field Value
System.Windows.DependencyProperty

TextProperty

Identifies the BarcodeText dependency property.

Declaration
public static readonly DependencyProperty TextProperty
Field Value
System.Windows.DependencyProperty

Properties

BarcodeEncodedText

This is the encoded text.

Declaration
protected string BarcodeEncodedText { get; set; }
Property Value
System.String

Checksum

This is the checksum, calculated on the barcode.

Declaration
protected string Checksum { get; set; }
Property Value
System.String

RenderChecksum

Gets or sets a value that determines whether the checksum should be included in the barcode's image. By default this property is set to true. Scanning barcodes with most of the standards will be possible only when they include checksum. You could use this property to turn off the auto calculated checksum if you have already calculated it yourself and passed it as part of the Text property.

Declaration
public bool RenderChecksum { get; set; }
Property Value
System.Boolean

true if the checksum should be included in the barcode's image; otherwise false. The default is true.

RestrictAspectRatio

Gets or sets a boolean value, indicating whether the aspect ratio should be preserved or not.

Declaration
public bool RestrictAspectRatio { get; set; }
Property Value
System.Boolean

ShowChecksum

Gets or sets a value that determines whether the checksum will be displayed at the end of the text.

Declaration
public bool ShowChecksum { get; set; }
Property Value
System.Boolean

true if the checksum is displayed at the end of the text; otherwise false. The default is true.

ShowText

Gets or sets a value that determines whether the text will be displayed.

Declaration
public bool ShowText { get; set; }
Property Value
System.Boolean

true if the text is displayed; otherwise false. The default is true.

Text

Gets or sets the Text entered by the user.

Declaration
public string Text { get; set; }
Property Value
System.String

Methods

GetLeadingZeros(String)

This method gets all leading zeroes in a string.

Declaration
protected static int GetLeadingZeros(string value)
Parameters
System.String value

Returns
System.Int32

GetTrailingZeros(String)

This method gets all trailing zeroes in a string.

Declaration
protected static int GetTrailingZeros(string value)
Parameters
System.String value

Returns
System.Int32

OnApplyTemplate()

Overrides the OnApplyTemplate method.

Declaration
public override void OnApplyTemplate()

OnCreateAutomationPeer()

Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
System.Windows.Automation.Peers.AutomationPeer

The type-specific System.Windows.Automation.Peers.AutomationPeer implementation.

RenderChecksumChangedHandler(DependencyObject, DependencyPropertyChangedEventArgs)

Called when the RenderChecksum property is changed.

Declaration
protected static void RenderChecksumChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs)
Parameters
System.Windows.DependencyObject source

The source.

System.Windows.DependencyPropertyChangedEventArgs eventArgs

The System.Windows.DependencyPropertyChangedEventArgs instance containing the event data.

RestrictAspectRatioChangedHandler(DependencyObject, DependencyPropertyChangedEventArgs)

Called when the RestrictAspectRatio property was changed.

Declaration
protected static void RestrictAspectRatioChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs)
Parameters
System.Windows.DependencyObject source

The source.

System.Windows.DependencyPropertyChangedEventArgs eventArgs

The System.Windows.DependencyPropertyChangedEventArgs instance containing the event data.

SetGridDimensions(Double, Size, Grid, Double, Double)

This method sets the dimensions of the barcode.

Declaration
protected static void SetGridDimensions(double codeRatio, Size availableSize, Grid codeGrid, double ratioWidth, double ratioHeight)
Parameters
System.Double codeRatio

System.Windows.Size availableSize

System.Windows.Controls.Grid codeGrid

System.Double ratioWidth

System.Double ratioHeight

ShowChecksumChangedHandler(DependencyObject, DependencyPropertyChangedEventArgs)

Called when the ShowChecksum property was changed.

Declaration
protected static void ShowChecksumChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs)
Parameters
System.Windows.DependencyObject source

The source.

System.Windows.DependencyPropertyChangedEventArgs eventArgs

The System.Windows.DependencyPropertyChangedEventArgs instance containing the event data.

ShowTextChangedHandler(DependencyObject, DependencyPropertyChangedEventArgs)

Called when the ShowText property was changed.

Declaration
protected static void ShowTextChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs)
Parameters
System.Windows.DependencyObject source

The source.

System.Windows.DependencyPropertyChangedEventArgs eventArgs

The System.Windows.DependencyPropertyChangedEventArgs instance containing the event data.

TextChangedHandler(DependencyObject, DependencyPropertyChangedEventArgs)

Called when the Text property was changed.

Declaration
protected static void TextChangedHandler(DependencyObject source, DependencyPropertyChangedEventArgs eventArgs)
Parameters
System.Windows.DependencyObject source

The source.

System.Windows.DependencyPropertyChangedEventArgs eventArgs

The System.Windows.DependencyPropertyChangedEventArgs instance containing the event data.

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.