TX Text Control .NET for WPF

Document Editor

Topic

In a WPF application, the editor of TX Text Control .NET for WPF is a control in the XAML of a window, and the toolbars, rulers, ribbon tabs and sidebars around it are controls as well. Seven tutorials build such a window step by step: first with the toolbox and a button bar, then in XAML alone, with a ribbon and sidebars, and finally with commands that open and save documents. After them, you know how the controls are declared, how they find each other by name, and where the startup code of the editor belongs.

Choose a Tutorial

TutorialYou buildDone in
Create Your First WPF ApplicationA .NET project with the NuGet package, the editor, a button bar, two rulers and a status barToolbox, Properties window, one handler
Create a .NET Framework ApplicationThe same editor in a .NET Framework 4.8 project, with a menu for files, the clipboard and formattingToolbox and code
Add TextControl in XAMLThe editor declared in XAML, with properties, events and a data binding, or created in codeXAML and code
Connect Rulers, Toolbars, and a Status BarThe bars connected in XAML or code, with your choice of buttons and status informationXAML and code
Create a WPF Ribbon ApplicationA RibbonWindow with the ribbon tabs of TX Text Control and a contextual Table Tools tabXAML and code
Add a SidebarA sidebar that ribbon buttons open with styles, comments or search panelsXAML and code
Load and Save DocumentsNew, Open, Save and Save As with a prompt for unsaved changes, in a menu or the ribbonCode

How the Controls Work Together

Every tutorial relies on the same few rules, which the pages explain where they are first needed:

  • One XAML namespace. The controls are in the namespace TXTextControl.WPF of the assembly TXTextControl.WPF, declared once in the Window element with a prefix such as WPF.
  • Connections by name. The TextControl finds its button bar, rulers, status bar and ribbon tabs through string properties that hold their names, and a sidebar finds the editor the same way.
  • Layout by the panel. A DockPanel places the bars at the sides of the window in the order of the XAML, and the TextControl, added last, fills the rest.
  • Startup code in Loaded. Code that works with the document runs in the Loaded event of the TextControl, when the editor is ready.

Where to Start

  1. Start with Create Your First WPF Application, or with Create a .NET Framework Application if your application runs on the .NET Framework.
  2. Read Add TextControl in XAML to understand the XAML the toolbox wrote.
  3. Decide on the user interface: a button bar, as in Connect Rulers, Toolbars, and a Status Bar, or a ribbon with sidebars, as in Create a WPF Ribbon Application and Add a Sidebar.
  4. Add Load and Save Documents, so that users can work with their files.

Before you start, install the setup of TX Text Control .NET for WPF on your development machine. It provides the NuGet package source, the toolbox tab and the XAML Designer support. See Installing the Product.

After These Tutorials