TX Text Control .NET for WPF

Integration Guide

Topic

Once the first window with TX Text Control .NET for WPF runs, the work of fitting it into a real application begins: XAML beyond the basics, controls created in code, the editor inside a UserControl, bindings, view models and commands, layouts that resize, application-wide styles, spell checking, barcodes and drawings, display scaling and accessibility. This guide is for WPF developers who have completed Getting Started and want the editor to follow the conventions of their own application.

How the Editor Connects to a WPF Application

The WPF.TextControl is a System.Windows.Controls.Control, declared in XAML with the namespace TXTextControl.WPF:

xmlns:WPF="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"

It connects to the rest of a window in four ways, and each page of this guide uses one or more of them:

  • By name. The bars, the ribbon tabs and TX Spell .NET are connected through string properties: ButtonBar="buttonBar1" names another element of the window, and SpellChecker names the key of a resource.
  • By binding. Dependency properties such as ZoomFactor and ViewMode are binding targets, and InputFormat is the binding source for everything that shows the formatting at the input position.
  • By event. WPF routed events such as Loaded and KeyDown, and the .NET events of TX Text Control such as Changed.
  • By method. Load, Save, Print and the dialog methods, called from code-behind, command handlers or an interface of your view model.

The document itself is not a dependency property. Its content moves through Load and Save, which Binding Document Content wraps in an attached property for bindings.

Find the Right Page

If you want toRead
Declare and configure the controls in XAMLXAML Integration
Create the editor and its bars in codeCreating and Configuring Controls in Code
Put the editor into a UserControl, a tab or a dialog windowEmbedding the Editor in Windows and UserControls
Run code when the editor is readyControl Initialization and Document Access
Bind controls to the formatting, or a view model to the documentData Binding
Build the window with a view modelMVVM Integration Patterns
Connect menus, buttons and keys through commandsCommands and Input Bindings
Arrange the editor in a Grid or DockPanel that resizesWPF Layout and Resizing
Share styles, colors and converters across windowsResource Dictionaries and Styling
Add spell checking with TX Spell .NETIntegrating TX Spell .NET for WPF
Add barcodes and drawings to documentsIntegrating WPF Barcodes and Drawings
Handle displays with a scale factorDPI and Display Scaling
Support screen readers and UI automationAccessibility and UI Automation
Let an AI coding assistant look up the TX Text Control documentationAI Coding Assistants

Where to Start

  1. XAML Integration and Control Initialization and Document Access: the basics every other page builds on.
  2. WPF Layout and Resizing to place the editor in your window.
  3. Data Binding, then Commands and Input Bindings or MVVM Integration Patterns, depending on how your application is structured.
  4. The remaining pages as your application needs them.

Pages in This Section