TX Text Control .NET for WPF

MVVM Integration Examples

Topic

Are there samples of TX Text Control .NET for WPF in an application built with the Model-View-ViewModel (MVVM) pattern? No: none of the sample applications of Text Control, on GitHub or installed by the setup, uses a view model, commands or bound document content. The official samples handle events in code-behind. What exists are the pieces an MVVM view is built from, and the pages below show them.

What You Can Build on

In MVVM, the view connects its controls to data through bindings instead of event handlers. TX Text Control .NET for WPF offers these bindable parts:

ExampleWhat it showsWhere
Formatting at the input positionWPF controls bound to the properties of InputFormat, such as a toggle button for bold text, in XAML onlyXAML and Data Binding Examples
Value convertersThe converters of the namespace TXTextControl.WPF, which translate colors, units, zoom factors and enumeration values for WPF controlsXAML and Data Binding Examples
State of the editorButtons enabled through bindings to CanUndo and CanRedo in the TX Words ribbon samplesXAML and Data Binding Examples
Dependency propertiesZoomFactor and other properties that the reference describes as dependency properties, which can be the target of a bindingThe reference page of each property

The content of the document is not among them: the reference doesn't describe TextControl.Text as a dependency property, and no source shows the document content bound to a view model.

Where the Pattern Is Described

MVVM Integration Patterns in the Integration Guide describes how the TextControl fits into an MVVM application, and Data Binding explains the bindings it relies on.

Next Steps