MVVM Integration Examples
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:
| Example | What it shows | Where |
|---|---|---|
| Formatting at the input position | WPF controls bound to the properties of InputFormat, such as a toggle button for bold text, in XAML only | XAML and Data Binding Examples |
| Value converters | The converters of the namespace TXTextControl.WPF, which translate colors, units, zoom factors and enumeration values for WPF controls | XAML and Data Binding Examples |
| State of the editor | Buttons enabled through bindings to CanUndo and CanRedo in the TX Words ribbon samples | XAML and Data Binding Examples |
| Dependency properties | ZoomFactor and other properties that the reference describes as dependency properties, which can be the target of a binding | The 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
- XAML and Data Binding Examples: the XAML of the bindings and converters.
- GitHub Examples: the sample applications of TX Text Control .NET for WPF.
- Value Converters: the converters in detail.