Touch in UWP RichTextBox (SfRichTextBoxAdv)

10 May 20211 minute to read

In UWP application, you should specify the ManipulationMode property for the controls in order to enable touch manipulations such as pan/scroll and zoom. Similarly, you should specify the ManipulationMode property for the SfRichTextBoxAdv control.
The following code example demonstrates how to configure all the touch manipulations in SfRichTextBoxAdv control.

<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" ManipulationMode="All" xmlns:RichTextBoxAdv="using:Syncfusion.UI.Xaml.RichTextBoxAdv"/>
// Initializes a new instance of SfRichTextBoxAdv control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
// Specifies the manipulation mode for the control.
richTextBoxAdv.ManipulationMode = ManipulationModes.All;

You can configure the specific touch manipulations for an UIElement by setting appropriate combinations of Manipulation modes. The following table demonstrates the Manipulation modes for enabling specific touch manipulations.

Touch Manipulation

ManipulationMode

Vertical scrolling only TranslateY, TranslateInertia
Horizontal scrolling only TranslateX, TranslateInertia
Vertical and horizontal scrolling only TranslateX, TranslateY, TranslateInertia
Scaling only Scale, ScaleInertia
Scrolling and scaling only Scale, ScaleInertia, TranslateX, TranslateY, TranslateInertia

The following code example demonstrates how to configure the touch manipulations for scrolling and scaling alone in SfRichTextBoxAdv control.

<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" ManipulationMode="Scale, ScaleInertia, TranslateX, TranslateY, TranslateInertia" xmlns:RichTextBoxAdv="using:Syncfusion.UI.Xaml.RichTextBoxAdv"/>
// Initializes a new instance of SfRichTextBoxAdv control.
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
// Specifies the manipulation mode for the control.
richTextBoxAdv.ManipulationMode = ManipulationModes.Scale | ManipulationModes.ScaleInertia | ManipulationModes.TranslateX | ManipulationModes.TranslateY | ManipulationModes.TranslateInertia;