TX Text Control .NET for WPF

What's New in TX Text Control .NET for WPF 20.0

Topic

Right-to-left languages such as Arabic and Hebrew arrived in TX Text Control with version 20.0. The WPF controls followed with a right-to-left layout of their own. The version also formats text for a language, hyphenates it with TX Spell .NET and merges business objects and data relations in MailMerge.

Version 20.0 was released in November 2013 as TX Text Control X10, together with TX Spell .NET 4.0 and TX Barcode .NET 3.0. The press release Press Release: TX Text Control X10 Released - Reporting and Right-to-Left Support also says that all components became fully compatible with multi-threading, which speeds up the creation of documents in batches.

Version 20.0 at a Glance

AreaWhat is new
Right-to-left textBidirectional lines, right-to-left paragraphs, Arabic Kashida justification
Right-to-left layoutMirrored TextControl, ruler bar, button bar, status bar, dialog boxes and context menus
LanguagesA language for each piece of text, a language dialog box, the language in the status bar
HyphenationAutomatic hyphenation with TX Spell .NET 4.0
Mail mergeData relations in every Merge overload, MergeObjects, image merging by name, NEXT and NEXTIF fields, report data source configurations
Button barButtons for more font attributes, font sizes, indents and the writing direction
Page imagesImages of pages with the elements shown on screen

Right-to-Left Text

  • Bidirectional lines. A line can contain text written from left to right and text written from right to left. Behind a left-to-right character, the input position is on its right side; behind a right-to-left character, it is on its left side.
  • Paragraph direction. ParagraphFormat.Direction formats a paragraph from right to left with the Direction value RightToLeft, so that its blocks of bidirectional text are ordered from right to left. In such a paragraph, a tab position is measured from the right page margin, and the natural alignment and the natural tab kind are right-aligned.
  • Change the direction. Selection.ChangeDirection changes the writing direction of the selected paragraphs. It swaps left and right alignment and left and right tabs; centered and justified paragraphs keep their alignment.
  • Kashida justification. Justified Arabic text can be stretched with Kashida lines instead of, or in addition to, wider spaces. ParagraphFormat.Justification takes a Justification value: Spaces, Kashida or SpacesAndKashida.
  • Input format. InputFormat.LeftToRight and InputFormat.RightToLeft tell the direction at the input position.

Right-to-Left Layout

The controls of TX Text Control support a right-to-left design of the application:

  • TextControl. The TextControl shows its vertical scroll bar on the left and zooms from its top right corner.
  • Dialog boxes and context menus. All built-in dialog boxes and context menus have a right-to-left design.
  • Toolbars. The ruler bar has a right-to-left ruler, and the button bar and the status bar show their buttons and parts from right to left. In a right-to-left paragraph, the horizontal ruler bar starts at the right page margin.
  • Paragraph dialog box. The paragraph formatting dialog box lets users format a paragraph from right to left.

Right-to-Left UI shows how a WPF application of the current version is mirrored.

Languages and Hyphenation

Spell Checking and Hyphenation covers spell checking and hyphenation in the current version.

Mail Merge

MailMerge creates documents from a template and data. Version 20.0 extended it considerably:

  • Data relations in every overload. All overloads of Merge process the relations between the tables of the data, which makes master-detail templates such as invoices with line items easier to merge. MergeBlocks is obsolete: it needed an extra merge block around the whole document for the same result.
  • Business objects. MergeObjects merges any collection of objects, a System.Collections.IEnumerable, into the template. Collections of Dictionary objects with string keys followed in Version 24.0. See Data Sources.
  • Images. Images in the template are replaced by name with the image data of the column of the same name and scaled to the width of the placeholder image. The column holds a byte array, System.Drawing.Image objects, file names or hexadecimal strings that start with X'. The ImageMerged event passes an ImageMergedEventArgs object. Column names of image merge fields no longer need the prefix image:, which still works. See Images and Barcodes.
  • Formats of merge fields. MergeField.DateTimeFormat and MergeField.NumericFormat hold the date and time format and the numeric format of a MERGEFIELD, which its field dialog box can now set.
  • NEXT and NEXTIF fields. The adapters NextField and NextIfField implement the MS Word fields NEXT and NEXTIF. See Conditional Content.
  • Report data source configurations. ReportDataSourceConfigFile takes the path of a report data source configuration file (.rdsc) created with TX Text Control Words, and ReportDataSourceConfig takes the same content as an XML string.
  • Template file. TemplateFile sets the path of the template, instead of calling LoadTemplate. The format is taken from the file extension.

Button Bar

New buttons of WPF.ButtonBar set strikeout, subscript and superscript, grow and shrink all font sizes of the selection, increase and decrease the paragraph indents and switch the writing direction between left-to-right and right-to-left.

Pages and Input Position

  • Screen elements in page images. The PageContent value ScreenElements makes Page.GetImage include what a screen shows in addition to the text, such as the selection, control characters and helper lines.
  • Caret size. InputPosition.CaretSize gets the size of the caret at the input position, in pixels.

Upgrade to Version 20.0

  • MergeBlocks. MailMerge.MergeBlocks is obsolete. Merge templates with Merge and pass the data with its relations. Deprecated APIs describes the replacement.
  • PageContent. The PageContent enumeration has the new value ScreenElements.

New Classes, Properties, Methods and Events

The classes and members below are the ones that the What's New documentation of version 20.0 lists for TX Text Control .NET for WPF. Names are relative to the TXTextControl namespace, each name links to its current reference page, and "(obsolete)" marks a member that is obsolete today.

New Classes

Members by Class

Next Steps

  • Version 21.0: the features of the next version.
  • Version 19.0: barcodes, even and odd headers and footers and page numbering.
  • Right-to-Left UI: right-to-left text and a mirrored window in the current version.