TX Text Control .NET for WPF

GitHub Examples

Topic

Text Control publishes the sample applications of TX Text Control .NET for WPF on GitHub, in the organization TextControl. They are the same samples that the setup installs into your Documents folder, so you can browse them before you install anything, or clone them into a project folder of your own. Because the GitHub copies were written for an earlier version, a few changes bring them to the current one.

What the Organization Contains

  • The sample index. TXSamples.NET lists the official sample repositories of all .NET products of Text Control.
  • The official WPF samples. TXSamples_WPF_CSharp and TXSamples_WPF_VB.NET contain 16 sample applications in three categories, each once for the .NET Framework 4.8 (folder .NET-Framework-48) and once for .NET 6 (folder .NET-Core-6):
    • Tutorial: the smallest word processor, with loading, saving, the clipboard, formatting dialog boxes, a button bar, two ruler bars and a status bar.
    • Howto: hyperlinks, mail merge, the mini toolbar, spreadsheet formulas in tables and XML files.
    • TX Words: the word processor sample and the nine samples built on it; see TX Words WPF Sample Application.
  • Single samples. A few repositories show one technique each, such as a print preview or line numbers. The topic pages of this section list them.
  • Other products. The organization also contains samples for TX Text Control .NET for Windows Forms, TX Text Control .NET Server, TX Spell .NET and DS Server. The examples pages of this section list only samples for WPF.
  • Agent Skills. The repositories txtextcontrol-document-editor-skills and txtextcontrol-servertextcontrol-skills hold skills for AI coding assistants, written for the Document Editor and ServerTextControl of TX Text Control .NET Server. AI Coding Assistants explains what they cover and how to connect an assistant to the Text Control MCP Server.

The blog article Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub introduced the repositories.

Run a Sample

WPF applications run on Windows only, and you need Visual Studio and TX Text Control .NET for WPF: the setup of the full or the trial version provides the packages and the license. See Installing the Product.

The repositories contain no solution files for the official samples: each sample is a project in its own folder. Clone the repository, update the sample as described in Update an Older Sample, and open the .csproj file of the sample in Visual Studio, or build it with the .NET CLI:

git clone https://github.com/TextControl/TXSamples_WPF_CSharp.git
cd "TXSamples_WPF_CSharp/.NET-Core-6/TX Words/TX Text Control WPF Words"
dotnet build

None of the repositories contains a nuget.config file: the packages come from the package source Text Control Offline Packages that the setup adds, or from the Text Control Private NuGet Feed. See Configuring Package Sources.

Update an Older Sample

The official samples on GitHub were last updated for version 32.0. The setup installs the samples of the current version; on GitHub, a few changes are needed.

.NET Samples

The projects in .NET-Core-6 target net6.0-windows and reference TXTextControl.TextControl.WPF.SDK in version 32.0.*. The package of version 34.0 requires .NET 8 or higher.

  1. Change the target framework in the .csproj file from net6.0-windows to net8.0-windows or higher.
  2. Update TXTextControl.TextControl.WPF.SDK to the current version, 34.0.5. See Installing and Updating Packages.
  3. Delete Properties\licenses.licx and the line of the .csproj file that embeds it. Since Service Pack 2 of version 32.0, .NET projects no longer use licenses.licx: the package adds the license file txtextcontrol.wpf.license, which the build embeds into your assembly. See Development Licenses.

.NET Framework Samples

The projects in .NET-Framework-48 reference the assemblies TXTextControl.dll and TXTextControl.WPF.dll of version 32.0, and the TX Words samples further assemblies such as TXDrawing.dll and TXBarcode.dll. Some projects give a path to them that doesn't exist on your machine.

  1. Remove the references to the TX Text Control assemblies and add them again from the Assembly folder of your installation.
  2. In Properties\licenses.licx, change the version in each entry to the version of the new assemblies. Since version 30.0, each entry names the full version, for example TXTextControl.WPF.TextControl, TXTextControl.WPF, Version=32.0.1700.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638.
  3. Rebuild the project.

Upgrading from Previous Versions and Breaking Changes describe the changes between the versions in detail.

Where to Start

ExampleWhat it showsWhere
Official WPF samples in C#The tutorial, the how-to samples and the TX Words samples for the .NET Framework 4.8 and .NET 6. Version 32.0TXSamples_WPF_CSharp
Official WPF samples in Visual BasicThe same samples in Visual Basic. Version 32.0TXSamples_WPF_VB.NET
Sample indexThe official sample repositories of all .NET productsTXSamples.NET

Samples by Topic

Next Steps