TX Text Control .NET for WPF

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

Topic

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

AreaWhat is new
DrawingsDrawings and preset shapes compatible with MS Word, the WPF control TXDrawingControl
Formatted textSubtext parts, collections for all text parts, symbol characters, Unicode bullets
EditingGrouped undo steps, text frames, barcodes and drawings drawn with the mouse
DocumentsAuthor, dates, keywords and subject saved with every format
Mail mergeMerge 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 as DrawingSelected, DrawingActivated and DrawingMoved, 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, SubTextPartClicked and SubTextPartDoubleClicked occur on TextControl.

Formatted Text

Undo Steps and Frames

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:

InterfaceMembers
IDataRowAdapterItem 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
IDataTableAdapterTableName, 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.Add and TextFrameCollection.Add received the overloads for inserting a frame with the mouse.
  • Obsolete members. ListFormat.CharAfterNumber and CharBeforeNumber, 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

.NET Members by Class

ClassPropertiesMethodsEvents
DataVisualization.DrawingCollectionAdd, CopyTo, DeactivateItem, GetActivatedItem, GetItem, Remove
DataVisualization.DrawingEventArgsDrawingFrame
DataVisualization.DrawingFrameDrawing, ExportCompressionQuality, ExportFileName, ExportFilterIndex, ExportResolution, SaveModeActivate, AddUndoUnit, Refresh
DocumentServer.DataSources.IDataRowAdapterItem, TableGetChildRows
DocumentServer.DataSources.IDataTableAdapterChildTableNames, ColumnNames, Rows, TableName
DocumentServer.MailMergeRemoveEmptyBlocks, RemoveEmptyImagesMergeObjectBlockMerging
DocumentServer.MailMerge.BlockMergingEventArgsBlockData, BlockName, ColumnNames
DocumentServer.MailMerge.ImageMergedEventArgsMerged
Drawing.SelectionCanBringForward, CanBringToFront, CanSendBackward, CanSendToBack, ShapesBringForward, BringToFront, IsCommonValueSelected, SendBackward, SendToBack
Drawing.ShapeAngle, AutoSize, Bounds, CanFitToCanvas, Flip, Index, IsSelected, Location, Movable, ShapeFill, ShapeOutline, Sizable, Size, TypeFitToCanvas
Drawing.Shape.FillColor
Drawing.Shape.OutlineColor, Width
Drawing.ShapeCollectionItemAdd, Insert, Remove
Drawing.ShapeEventArgsShape
HeaderFooterBarcodes, Charts, DocumentLinks, DocumentTargets, Drawings, Frames, SubTextParts
IFormattedTextBarcodes, DocumentLinks, DocumentTargets, Drawings, Frames, SubTextParts
ListFormatBulletCharacter, BulletSize, CharAfterNumber (obsolete), CharBeforeNumber (obsolete), FirstNumber, FontName, FormatCharacter, HangingIndent, LeftIndent, Level, NumberFormat, RestartNumbering, Type
LoadSettingsAuthor, CreationDate, CreatorApplication, DocumentKeywords, DocumentSubject, LastModificationDate, LoadSubTextParts
MainTextCharts
SaveSettingsAuthor, BytesWritten, CreationDate, CreatorApplication, CssFileName, CssSaveMode, DocumentKeywords, DocumentSubject, DocumentTitle, ImageSavePath, LastModificationDate, PageMargins, PageSize, SavedFile, SavedStreamType
ServerTextControlDrawings, SubTextPartsOnDrawingCreated, OnDrawingDeletedDrawingCreated, DrawingDeleted
SubTextPartHighlightColor, HighlightMode, ID, Length, Name, NestedLevel, Number, OuterMostSubTextPart, OuterSubTextPart, Start, TextSave, ScrollTo
SubTextPartCollectionCount, IsSynchronized, Item, SyncRootAdd, CopyTo, GetEnumerator, GetItem, Remove
SubTextPartEventArgsSubTextPart
TextCharCollectionAdd, Remove
TextFrameBarcodes, Charts, DocumentLinks, DocumentTargets, Drawings, Frames, SubTextParts
TextFrameCollectionGetActivatedItem
WPF.Drawing.ShapesContextMenuSelectedShapesMenuItems, StandardMenuItems
WPF.Drawing.TXDrawingControlBackColor, BorderColor, BorderWidth, CanCopy, CanPaste, CanRedo, CanUndo, IsCanvasVisible, Selection, Shapes, ZoomFactorClearUndo, Copy, Cut, FormatShapesDialog, Load, Paste, PrintPaint, Redo, Save, SaveImage, SelectAll, SetCanvasSize, SizeToContent, UndoAdaptBounds, Changed, ShapeAdjusted, ShapeClicked, ShapeCreated, ShapeDeselected, ShapeFlipped, ShapeFormatChanged, ShapeMoved, ShapeSelected, ShapeSized, ViewChanged
WPF.TextControlDrawingMarkerLines, Drawings, SubTextPartsAddSymbolDialog, BeginUndoAction, DrawingLayoutDialog, EndUndoAction, OnDrawingActivated, OnDrawingClicked, OnDrawingCreated, OnDrawingDeactivated, OnDrawingDeleted, OnDrawingDeselected, OnDrawingDoubleClicked, OnDrawingMoved, OnDrawingRightClicked, OnDrawingSelected, OnDrawingSized, OnSubTextPartClicked, OnSubTextPartDoubleClicked, OnSubTextPartEntered, OnSubTextPartLeftDrawingActivated, DrawingClicked, DrawingCreated, DrawingDeactivated, DrawingDeleted, DrawingDeselected, DrawingDoubleClicked, DrawingMoved, DrawingRightClicked, DrawingSelected, DrawingSized, SubTextPartClicked, SubTextPartDoubleClicked, SubTextPartEntered, SubTextPartLeft

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.