Using XAML with BarTender

Extensible Application Markup Language, commonly abbreviated as XAML, is a markup language that allows you to create objects, format text, and layout objects using tags. In BarTender, you can use XAML to modify the appearence of a text object by aligning text in tables, coloring text, or adding images to a text object.

An XAML tag represents an object, which initializes an element in the rich text object. For example, you could use the XAML tag <Rectangle> to insert a rectangle into the object. Objects are always introduced using an opening angle bracket (<), followed by the tag name. Attributes can optionally be added to the object element. To complete the object declaration, use a closing bracket (>). If the tag is not followed by any content, the closing bracket can be replaced with a forward slash, followed by the closing bracket (/>). The following example demonstrates the use of objects with XAML formatting.

<StackPanel>

<Ellipse Stroke="Black" />

</StackPanel>

Each object supports a number of optional attributes, which are properties of the object. Formatting changes are often defined as attributes of an object, since they describe the object. The following example creates an ellipse that has a red background and a black outline.

<Ellipse Background="Red" Stroke="Black" />

When XAML is used in a text object, BarTender takes the XAML and converts it to rich text format (RTF). Because of this conversion, BarTender does not support all applications and features of XAML; it only supports the features available in both XAML and RTF.

To configure a text object to accept XAML output

  1. Select the icon on the object toolbar. Alternatively, select Text from the Create menu.

  2. Under Markup Language Containers, select XAML.

  3. Click at the desired location on the template to add the text object.

  4. Double-click on the text object to open the Text Properties dialog. Alternatively, select Properties from the object's context menu.

  5. Select Markup Language from the list of available property pages.

  6. Under Markup Language, verify that Extensible Application Markup Language (XAML) is selected from the dropdown list.

  7. Select the desired data source from the Navigation Pane to display the Data Source property page.

  8. Input the desired XAML into the Embedded Data field. Alternatively, you can modify the source to automatically import XAML from another data source, such as a database or VB Script.