In This Article

BarCodeSymbology Class

Provides the base class for a bar code symbology.

public abstract class BarCodeSymbology : FrameworkElement, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
Inheritance:
Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Object
Derived:
Grid2DBarCodeSymbology LinearBarCodeSymbology

Remarks

For detailed documentation on this symbology's features and how to use them, please see the Bar Code Symbology-related series of documentation topics.

Constructors

BarCodeSymbology()

Initializes a new instance of the BarCodeSymbology class.

protected BarCodeSymbology()

Properties

Background

Gets or sets the Brush to use for rendering the background.

public Brush Background { get; set; }

Property Value

Brush:

The Brush to use for rendering the background. The default background is White.

DisplayName

Gets the display name of the symbology.

public string DisplayName { get; }

Property Value

String:

The display name of the symbology.

Foreground

Gets or sets the Brush to use for rendering the foreground.

public Brush Foreground { get; set; }

Property Value

Brush:

The Brush to use for rendering the foreground. The default foreground is Black.

Value

Gets or sets the value to encode in the bar code.

[Localizability(LocalizationCategory.Label)]
public string Value { get; set; }

Property Value

String:

The value to encode in the bar code.

Methods

MeasureDesiredSize(Size)

Measures the desired size of the symbology, based on the specified available size.

public Size MeasureDesiredSize(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

OnRender(DrawingContext)

When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

protected override void OnRender(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The drawing instructions for a specific element. This context is provided to the layout system.

OnValueChanged(String, String)

Occurs when the value of the Value property is changed.

protected virtual void OnValueChanged(string oldValue, string newValue)
Parameter Type Description
oldValue String

The old value.

newValue String

The new value.

Render(DrawingContext, Point, Size)

Renders the symbology to the specified DrawingContext.

public abstract void Render(DrawingContext drawingContext, Point location, Size size)
Parameter Type Description
drawingContext DrawingContext

The DrawingContext upon which to render the symbology.

location Point

The location at which to draw the bar code.

size Size

The size of the bar code to draw.

ToBitmap(Double, Double)

Creates a BitmapSource based on the contents of the symbology.

public BitmapSource ToBitmap(double dpiX, double dpiY)
Parameter Type Description
dpiX Double

The x DPI.

dpiY Double

The y DPI.

Returns

BitmapSource:

The BitmapSource that was created.

Remarks

It is recommended that this symbology not have a visual parent when calling this method.

ValidateValue(String)

Validates that the symbology can parse the specified value.

public abstract ValidationResult ValidateValue(string value)
Parameter Type Description
value String

The value to validate.

Returns

ValidationResult:

A ValidationResult containing the result of the validation.

Fields

BackgroundProperty

Identifies the Background dependency property. This field is read-only.

public static readonly DependencyProperty BackgroundProperty

ForegroundProperty

Identifies the Foreground dependency property. This field is read-only.

public static readonly DependencyProperty ForegroundProperty

ValueProperty

Identifies the Value dependency property. This field is read-only.

public static readonly DependencyProperty ValueProperty

Inherited Members

Extension Methods