What's New in TX Text Control .NET for WPF 23.0
Drawings, subtext parts and document properties are the additions of version 23.0 that TX Text Control .NET for WPF still builds on. The version also brought a dialog box for symbol characters, undo steps that group several changes and frames that users draw with the mouse, and it changed how merge blocks are stored in mail merge templates.
Version 23.0 was released on December 9, 2015, as TX Text Control X13, together with TX Text Control .NET Server, TX Text Control .NET for Windows Forms and TX Text Control ActiveX. Its last full installer, that of Service Pack 1, is dated August 8, 2016. The features below are the ones added since version 22.0.
Version 23.0 at a Glance
| Area | What is new |
|---|---|
| Drawings | Drawings and preset shapes compatible with MS Word, the WPF control TXDrawingControl |
| Formatted text | Subtext parts, collections for all text parts, symbol characters, Unicode bullets |
| Editing | Grouped undo steps, text frames, barcodes and drawings drawn with the mouse |
| Documents | Author, dates, keywords and subject saved with every format |
| Mail merge | Merge blocks as subtext parts, MergeObject, the BlockMerging event |
Drawings and Shapes
TX Text Control supports drawings and the preset shapes of ISO/IEC 29500-1, section 20.1.10.55. A drawing is a single shape or a canvas with several shapes. See Text Frames and Shapes and Integrating WPF Barcodes and Drawings.
- Positioning. A DrawingFrame positions the drawing like an image or a text frame: as a single character, anchored to a paragraph or at a fixed position in the document.
- The drawing control. Each drawing frame belongs to a WPF.Drawing.TXDrawingControl, returned by DrawingFrame.Drawing, which handles the appearance and the data of the drawing. Its shapes are in a Drawing.ShapeCollection, and the control can be programmed completely. The ShapesContextMenu is its context menu.
- The collection. TextControl.Drawings returns the DrawingCollection, which adds and removes drawings. DrawingCreated and
DrawingDeleted, and events such asDrawingSelected,DrawingActivatedandDrawingMoved, report the changes. - Editing. Users can activate a drawing and change its shapes with built-in mouse and keyboard interfaces. TextControl.DrawingLayoutDialog opens a dialog box for the position, the size and the text distances of a drawing, and DrawingMarkerLines is also new.
- File formats. Drawings are saved and loaded with the TX Text Control format and DOCX. Other formats save the drawing's image.
Subtext Parts
The main text, text frames, headers and footers are the text parts of a document. A SubTextPart is a smaller piece of text that you define to work on it separately. See Subtext Parts.
- Defining one. A subtext part is defined by a start position and a length or by a selection. TextControl.SubTextParts returns the SubTextPartCollection of the main text, which adds and removes subtext parts; text frames, headers and footers have their own.
- Name, ID and highlighting. A subtext part has a name and an ID. It can be highlighted always or only while it contains the input position, set with HighlightMode.
- Nesting. Subtext parts can contain other subtext parts, but they can't overlap.
- Saving. SubTextPart.Save saves the content to a byte array or a string, in every format TX Text Control supports.
- Loading. LoadSettings.LoadSubTextParts is also new in this version.
- Events. SubTextPartEntered,
SubTextPartLeft,SubTextPartClickedandSubTextPartDoubleClickedoccur onTextControl.
Formatted Text
- Collections for all text parts. Document links, document targets, frames, charts, barcodes and drawings are available in every text part: the main text, headers, footers and text frames. IFormattedText.Drawings is one of the new properties.
- Symbol characters. TextControl.AddSymbolDialog opens a dialog box for inserting a symbol character, and TextCharCollection.Add received overloads that add symbol and control characters in code.
- Bullets. The bullet of a list is no longer limited to the Windows Symbol font. ListFormat.FontName sets its font, and ListFormat.BulletCharacter can be any Unicode character. The dialog box of TextControl.ListFormatDialog sets both. See Bullets and Numbered Lists.
Undo Steps and Frames
- Grouped undo steps. TextControl.BeginUndoAction and EndUndoAction group all editing and formatting changes between them into one step that is undone and redone at once. UndoActionName returns its name. See Undo and Redo.
- Inserting frames with the mouse. New overloads of TextFrameCollection.Add, BarcodeCollection.Add and DrawingCollection.Add take a frame and a FrameInsertionMode value. The user then draws the frame in the document with the mouse, and the object is inserted when the mouse button is released.
Document Properties
General document properties are saved with every supported format: SaveSettings.Author, CreationDate, CreatorApplication, DocumentKeywords, DocumentSubject and LastModificationDate. After a document is loaded, the properties of the same names of LoadSettings, such as LoadSettings.Author, return them. See Document Properties.
Mail Merge
MailMerge creates documents from a template and data.
- Merge blocks as subtext parts. Merge blocks, the sections of a template that are repeated for each record, are stored as subtext parts instead of document targets. Templates with blocks in the old format still load. See Merge Blocks.
- A single object. MailMerge.MergeObject merges one object. Before, a single record of object data had to be wrapped in an enumerable type such as an array or a list. See Objects and Collections.
- Empty blocks and images. RemoveEmptyBlocks removes the content of merge blocks without data, and RemoveEmptyImages removes images without merge data. See Conditional Content.
The Data of a Merge Block
The BlockMerging event occurs before a merge block is merged. Its BlockMergingEventArgs contain the name of the block, the column names of its table and, in BlockData, the data rows.
The rows and tables of this data are described by two interfaces, also new in version 23.0:
| Interface | Members |
|---|---|
| IDataRowAdapter | Item returns the content of a column by its name, Table the table the row belongs to, and GetChildRows the rows of a child relation by its name |
| IDataTableAdapter | TableName, ColumnNames, Rows (the rows as IDataRowAdapter objects) and ChildTableNames, the names of the table's child relations |
Merge Events describes the events of a merge run.
Upgrade to Version 23.0
- Merge block format. Templates created with version 23.0 store merge blocks as subtext parts. Templates with blocks in the old format, based on document targets, still load.
- Update notes.
BarcodeCollection.AddandTextFrameCollection.Addreceived the overloads for inserting a frame with the mouse. - Obsolete members.
ListFormat.CharAfterNumberandCharBeforeNumber, which the list of version 23.0 names, are obsolete today; Deprecated APIs names their replacements. - Other breaking changes. Breaking Changes starts with version 30.0.
New Classes, Properties, Methods and Events
These are the classes and members that the What's New documentation of version 23.0 lists for TX Text Control .NET for WPF, without the ASP.NET classes that the list also names. Names are relative to the TXTextControl namespace. Each name links to its current reference page, and "(obsolete)" marks the members that are obsolete today. The reference marks the Charts property of FootnoteSection and FootnoteText as introduced in version 23.0, but both classes came with footnotes in version 32.0, so they are left out here.
New Classes
- DataVisualization.DrawingCollection
- DataVisualization.DrawingEventArgs
- DataVisualization.DrawingFrame
- DocumentServer.MailMerge.BlockMergingEventArgs
- Drawing.Selection
- Drawing.Shape
- Drawing.Shape.Fill
- Drawing.Shape.Outline
- Drawing.ShapeCollection
- Drawing.ShapeEventArgs
- ListFormat
- SaveSettings
- SubTextPart
- SubTextPartCollection
- SubTextPartEventArgs
- WPF.Drawing.ShapesContextMenu
- WPF.Drawing.TXDrawingControl
.NET Members by Class
Next Steps
- Version 24.0: the features of the next version.
- Version 22.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X13 for Windows Forms, WPF, ASP.NET and ActiveX Released: the release announcement on the Text Control Blog.