What's New in TX Text Control .NET for WPF 19.0
Barcodes became part of the document in TX Text Control 19.0, next to images and text frames, and the WPF TextControl received built-in context menus. The version also gave headers and footers separate content for even and odd pages, restarted page numbers per section, and let MailMerge fill barcodes and charts with data.
Version 19.0 was released in April 2013 as TX Text Control X9, together with the new TX Barcode .NET 2.0, as the blog article TX Text Control X9 and TX Barcode .NET Have Been Released announced. The WPF control was sold as TX Text Control .NET for WPF and, together with the server components, as TX Text Control Server for ASP.NET (incl. WPF).
Version 19.0 at a Glance
| Area | What is new |
|---|---|
| Headers and footers | Different headers and footers for even and odd pages, a dividing line with a label |
| Barcodes | Barcode frames in the text, positioned like images, with a layout dialog box and events |
| User interface | Built-in context menus, permanent control characters, the anchor symbol, selection events for images and text frames |
| Page numbering | Restarted numbering per section, the total number of pages, a page number dialog box |
| MS Word content controls | Imported from DOCX as application fields |
| Mail merge | Merging into barcodes and charts, canceling a merge, new events |
Barcodes
Barcode controls of the type TXTextControl.Barcode.TXBarcodeControl can be inserted into a document:
- Position. A barcode is placed like an image or a text frame: as a character in the text, anchored to a paragraph or at a fixed position in the document. A DataVisualization.BarcodeFrame positions it and is connected to the barcode control, which holds the appearance and the data.
- Collection. WPF.TextControl.Barcodes and ServerTextControl.Barcodes return a DataVisualization.BarcodeCollection, which adds and removes barcodes. The events BarcodeCreated and BarcodeDeleted report changes.
- User interface. WPF.TextControl.BarcodeLayoutDialog opens a dialog box for the position, the size and the distances to the text. The
TextControlraises events when a barcode is selected, deselected, clicked, double-clicked, right-clicked, moved or sized, such as BarcodeSelected and BarcodeMoved. - Formats. The TX Text Control format and RTF save a barcode as a barcode, which is rebuilt when the document is loaded. Other formats save its image. On a system without the barcode controls, the image is inserted instead.
Charts and Barcodes shows how barcodes are used in the current version.
Page Numbering
- Restart the numbering. SectionFormat.RestartPageNumbering restarts the page numbers of a section instead of continuing those of the previous section.
- Page number fields. A PageNumberField, a field in a header or footer, shows the page number with a NumberFormat and a StartNumber, or, with ShowNumberOfPages, the total number of pages. PageNumberField.PageNumberDialog opens a dialog box for the format and the numbering of a page number field.
User Interface
- Built-in context menus. A right click opens a context menu with the standard commands for the place that was clicked: text formatting, inserting and editing headers and footers together with the page settings, or images and text frames.
- Change a context menu. Before a built-in menu opens, the TextContextMenuOpening event occurs. Its WPF.TextContextMenuEventArgs give the ContextMenuLocation in the document, and through TextContextMenu a handler changes or extends the menu, replaces it with its own or suppresses it. See Context Menus.
- Anchor symbol. A control character left of the first character of a paragraph shows where a selected object is anchored.
- Permanent control characters. PermanentControlChars shows single control characters all the time, whatever the value of
ControlChars. - Selection events. ImageSelected, ImageDeselected, TextFrameSelected and TextFrameDeselected occur when an image or a text frame is selected or deselected.
- Tables. A new overload of TableCollection.Add opens a dialog box in which users specify the new table.
MS Word Content Controls
When a DOCX document is loaded, its MS Word content controls are converted to fields of the type ApplicationField. Version 21.0 added adapter classes for them; Fields and Subtext Parts describes fields and their adapters today.
Mail Merge
- Barcodes. MailMerge merges data into a
BarcodeFramewhose name is the name of a table column, like a merge field. This also works in merge blocks. See Images and Barcodes. - Charts. Data is merged into a ChartFrame outside of merge blocks through data relations, which have to be part of the
DataTablepassed to Merge. - Cancel a merge. After each merged data row, setting Cancel of the DataRowMerged event stops the merge, which then throws a MergeCanceledException.
- Events. BarcodeMerged and ChartMerged occur after a barcode or a chart has been merged.
- Block fields. GetBlockFieldNames returns the field names of a merge block, and IncludeTextMergingEventArgs.IncludeTextField returns the INCLUDETEXT field that is being merged.
Upgrade to Version 19.0
- HeaderFooterType. The methods of
HeaderFooterCollectionaccept the new valuesEvenHeaderandEvenFooter. Code that handles all values of HeaderFooterType has to handle these as well. - HeaderFooterFrameStyle. The property
HeaderFooterFrameStylehas the new valueDividingLine.
New Classes, Properties, Methods and Events
The classes and members below are the ones that the What's New documentation of version 19.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. The version's own list also names the event ShapeDeleted of WPF.Drawing.TXDrawingControl, a class that the reference dates to version 23.0, and the reference dates the event ShapeDeleted of Drawing.TXDrawingCore to 19.0, although the class came with version 33.0; both are left out here. The list also names PageNumberField as a new class, but PageNumberFieldCollection already took PageNumberField objects in version 13.0, so it isn't listed under New Classes.
New Classes
- DataVisualization.BarcodeCollection
- DataVisualization.BarcodeEventArgs
- DataVisualization.BarcodeFrame
- DocumentServer.MailMerge.BarcodeMergedEventArgs
- DocumentServer.MailMerge.ChartMergedEventArgs
- DocumentServer.MergeCanceledException
- WPF.TextContextMenuEventArgs
Members by Class
Next Steps
- Version 20.0: the features of the next version.
- Version 18.0: charts, z-order and the frame collection.
- Images and Barcodes: merge data into barcodes.