Integration Guide
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
ViewModeare 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
LoadedandKeyDown, and the .NET events of TX Text Control such asChanged. - By method.
Load,Save,Printand 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 to | Read |
|---|---|
| Declare and configure the controls in XAML | XAML Integration |
| Create the editor and its bars in code | Creating and Configuring Controls in Code |
Put the editor into a UserControl, a tab or a dialog window | Embedding the Editor in Windows and UserControls |
| Run code when the editor is ready | Control Initialization and Document Access |
| Bind controls to the formatting, or a view model to the document | Data Binding |
| Build the window with a view model | MVVM Integration Patterns |
| Connect menus, buttons and keys through commands | Commands and Input Bindings |
Arrange the editor in a Grid or DockPanel that resizes | WPF Layout and Resizing |
| Share styles, colors and converters across windows | Resource Dictionaries and Styling |
| Add spell checking with TX Spell .NET | Integrating TX Spell .NET for WPF |
| Add barcodes and drawings to documents | Integrating WPF Barcodes and Drawings |
| Handle displays with a scale factor | DPI and Display Scaling |
| Support screen readers and UI automation | Accessibility and UI Automation |
| Let an AI coding assistant look up the TX Text Control documentation | AI Coding Assistants |
Where to Start
- XAML Integration and Control Initialization and Document Access: the basics every other page builds on.
- WPF Layout and Resizing to place the editor in your window.
- Data Binding, then Commands and Input Bindings or MVVM Integration Patterns, depending on how your application is structured.
- The remaining pages as your application needs them.
Pages in This Section
- XAML Integration: the controls of TX Text Control in XAML.
- Creating and Configuring Controls in Code: the editor and its bars created and connected at run time.
- Embedding the Editor in Windows and UserControls: the editor inside other WPF containers.
- Control Initialization and Document Access: when the editor is ready for a document.
- Data Binding: bindings to
InputFormat, the document content and the value converters. - MVVM Integration Patterns: a view model with the document, settings and commands, and the code-behind that remains.
- Commands and Input Bindings: routed commands, command bindings and key bindings for the editor.
- WPF Layout and Resizing:
DockPanel,Grid, view modes and the size of the editor. - Resource Dictionaries and Styling: implicit styles, color sets and converters in App.xaml.
- Integrating TX Spell .NET for WPF: spell checking in the editor with TX Spell .NET.
- Integrating WPF Barcodes and Drawings: barcodes and drawings in the documents of the editor.
- DPI and Display Scaling: the editor and its bars on displays with a scale factor above 100%.
- Accessibility and UI Automation: the editor for screen readers and UI automation.
- AI Coding Assistants: the Text Control MCP Server and Agent Skills for GitHub Copilot, Claude Code and other assistants.