
One of the major motivations to port Windows Forms applications to WPF are powerful data binding capabilities.
Interface controls, such as buttons or dropdown menus of a Ribbon bar can be easily connected to TX Text Control without writing one single line of C# or VB.NET code. The connection can be completely done in XAML, making such bindings quick, flexible and easy to implement.
Consider the following example:
A ToggleButton should visualize, whether the character formatting at the current input position is bold or not and it should change this state when the button is clicked. In this case, the target of the data binding is the IsChecked property of the ToggleButton. The source is the Bold property of the new TX Text Control WPF.InputFormat class. This class represents all formatting attributes at the current text input position. The properties of this class are updated automatically when the input position changes.
The following XAML code shows the ToggleButton and it's binding:
<ToggleButton Name="tbtnBold" Content="Bold" Focusable="False"
IsChecked="{Binding
ElementName=textControl1,
Path=InputFormat.Bold, Mode=TwoWay}" />In the Binding statement the Mode attribute has been set to TwoWay. This attribute specifies how the data flows between the source and the target. The following methods are available:
This feature is available or partially available in the following TX Text Control .NET for Windows Forms products: