What's New in TX Text Control .NET for WPF 25.0
Protected documents with editable regions are the center of version 25.0: a document can forbid editing, formatting, printing or copying, while selected parts stay editable for named users, and a new ribbon tab sets both up. TX Text Control .NET for WPF also received mini toolbars, a thesaurus dialog box and the UI Automation text pattern, and it allowed objects anywhere on a page from headers and footers.
Version 25.0 was released on December 13, 2017, as TX Text Control X15, together with TX Text Control .NET Server, TX Text Control .NET for Windows Forms, TX Text Control ActiveX and TX Spell .NET 7.0. Its last full installer is dated November 21, 2018. The features below are the ones added since version 24.0.
Version 25.0 at a Glance
| Area | What is new |
|---|---|
| Protection | Document permissions and passwords, editable regions per user, the Permissions ribbon tab |
| User interface | Mini toolbars, selection of objects behind the text, a thesaurus dialog box |
| Accessibility | The UI Automation text pattern |
| Headers and footers | Images, text frames, barcodes and drawings anywhere on the page, such as watermarks |
| Tables | Page break settings of paragraphs applied to table rows |
| .NET Framework | TX Text Control .NET for WPF compiled with .NET Framework 4.5 |
Documents With Restricted Access
A document can restrict what users may do with it: edit it, format it, print it or copy its content to the clipboard. See Document Protection and Editable Regions.
- Permissions. A DocumentPermissions object, returned by TextControl.DocumentPermissions, holds the restrictions:
AllowCopy,AllowFormatting,AllowFormattingStyles,AllowPrintingand ReadOnly. - Activation. The restrictions take effect when TextControl.EditMode changes from
EdittoReadAndSelect. With the edit modeUsePassword, a dialog box asks for a password that protects the restrictions; the same password is needed to switch back toEdit. - In the document. The permissions and the password are saved in the document in encrypted form. A password-protected document opens read-only. The supported formats are RTF, DOC, DOCX, PDF and the TX Text Control format.
Editable Regions
An editable region is a piece of text that stays editable when the document is read-only.
- Defining a region. An EditableRegion is defined by a start position and a length or by a selection. Regions may overlap. TextControl.EditableRegions returns the EditableRegionCollection of the main text, which adds and removes regions; headers, footers and text frames have their own.
- Users. EditableRegion.UserName names the user who may edit the region; an empty string means everyone. TextControl.UserNames sets the users who have access to the document.
- Highlighting. Regions are highlighted in a color that depends on the user name. EditableRegion.HighlightColor sets another color.
- Events.
TextControlraises EditableRegionCreated, EditableRegionDeleted, EditableRegionEntered and EditableRegionLeft. - What is possible where. In a protected document, editing and formatting depend on the input position. TextControl.CanEdit, CanCharacterFormat, CanParagraphFormat, CanTableFormat and the properties
CanStyleFormat,CanDocumentFormatandCanPrinttell what is currently allowed, so that an application can enable or disable its menu items and buttons. - Ribbon. The new RibbonPermissionsTab is a predefined ribbon tab for setting restrictions and adding editable regions.
Mini Toolbars
Besides context menus, TX Text Control offers built-in mini toolbars: small toolbars with the formatting options of the current context. See Toolbars and Mini Toolbars.
- When they appear. A mini toolbar opens when the right mouse button is released, or when the left mouse button is released while text is selected. TextControl.ShowMiniToolbar controls this.
- Two kinds. The TextMiniToolbar formats text and has additional items in tables; the ObjectMiniToolbar formats images, text frames, drawings and barcodes.
- Changing them. MiniToolbarOpening occurs before a mini toolbar is shown. Its handler can change or extend the toolbar, show a toolbar of its own or suppress it. TextMiniToolbarInitialized and ObjectMiniToolbarInitialized are also new.
Selecting Objects in the Background
TextControl.SelectObjects decides what a mouse click selects when an object lies behind the text. With true, the click selects the object in the background; with false, it selects the text in front of it. The RibbonFormattingTab received a Select Objects button.
Thesaurus
TX Text Control finds synonyms for the word at the input position. The RibbonProofingTab received two buttons, one that loads thesaurus files from a directory and one that opens the built-in ThesaurusDialog. The thesaurus needs TX Spell .NET 7.0. See Integrating TX Spell .NET for WPF.
UI Automation
The WPF TextControl implements the text pattern of UI Automation, which exposes the text of a loaded document through text ranges. Accessibility tools use this information to make applications usable for people with vision, hearing or motion disabilities. See Accessibility and UI Automation.
Pagination in Tables
The paragraph settings "keep with next" (ParagraphFormat.KeepWithNext) and "page break before" (ParagraphFormat.PageBreakBefore) control automatic page breaks, and since version 25.0 they work in tables as well. A table row can contain several paragraphs, so one of them decides for the whole row:
- The first paragraph of a row decides. The pagination settings of all other paragraphs in the row are ignored.
- Page break before. If the first paragraph of a row has this setting, the complete row moves to a new page.
- Keep with next. If the first paragraph of a row has this setting, the row stays on the same page as the row that follows it.
The new value Pagination of the PermanentControlChar enumeration marks paragraphs with these settings. Tables and Table Formulas describes tables.
Other API Additions
- TextControl.SelectWord selects a word, and ContentsReset, SubTextPartCreated and
SubTextPartDeletedare new events ofTextControl.ServerTextControlreceived the same members. - TextControl.PointToDocument and PointFromDocument convert points between the coordinates of the control and document coordinates, in twips from the top-left corner of the document.
- FrameBase.Bounds returns the bounding rectangle of a frame, relative to the upper left corner of the document.
.NET Framework
TX Text Control .NET for WPF 25.0 was compiled with .NET Framework 4.5. Deploying .NET Framework Applications describes the .NET Framework applications of today's version.
Upgrade to Version 25.0
- Update notes. PageCollection.GetItem received an overload that returns the page at a text input position, and
PermanentControlCharwas extended withPagination. - Breaking changes. No change of version 25.0 is known to break existing code. 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 25.0 lists for TX Text Control .NET for WPF. Names are relative to the TXTextControl namespace. Each name links to its current reference page.
New Classes
- DocumentPermissions
- EditableRegion
- EditableRegionCollection
- EditableRegionEventArgs
- WPF.MiniToolbar
- WPF.MiniToolbarInitializedEventArgs
- WPF.MiniToolbarOpeningEventArgs
- WPF.ObjectMiniToolbar
- WPF.RibbonPermissionsTab
- WPF.TextMiniToolbar
- WPF.ThesaurusDialog
.NET Members by Class
Next Steps
- Version 26.0: the features of the next version.
- Version 24.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X15 and TX Spell .NET 7.0 Released: the release announcement on the Text Control Blog.