SfRichTextBoxAdv scrolling lags on UWP (mobile)

Hi.

 

I am using the SfRichTextBoxAdv in a reader app, and for the most part it works fine. Customization of the control are really exceptional. However, I am facing performance issues on my UWP app which targets both Windows and Windows Mobile 10.

 

I am loading data into the control through binding using an HTML string. The data loading speed is good. The problem comes when I start scrolling.

 

Scrolling works fine on desktop, however on Mobile the scrolling is extremely stuttery and laggy, making the framerate of the app come down before 30fps. I believe virtualization is working, as I have not violated any rules for breaking it (such as placing it inside a scrollviewer or stackpanel), but scrolling is still very slow on mobile. I am using the control as:

 

1. Placed inside a relativepanel control which means height and width etc are not set to "auto". They are defined by the relativepanel itself.

 

2. The data is coming from the View, which uses the Load() method of the RTBA to inject html string-to-stream data into it as richTextBoxAdv.Load(stream, Syncfusion.UI.Xaml.RichTextBoxAdv.FormatType.Html);

 

3. The code for the control is as follows:

 <common:SfRichTextBoxAdv x:Name="richTextBoxAdv" 
                                   EnableRadialMenu="False" 
                                   TextWrapping="Wrap"
                                   IsZoomEnabled="False"
                                   ManipulationMode="All" 
                                   LayoutType="Continuous"
                                   Background="{ThemeResource SystemControlPageBackgroundChromeLowBrush}"
                                   Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
                                   OverridesDocumentBackground="True"
                                   IsReadOnly="True"
                                   FontFamily="Segoe UI" >
                <interactivity:Interaction.Behaviors>
                    <core:EventTriggerBehavior EventName="Loaded">
                        <core:InvokeCommandAction Command="{Binding RTBALoadedCommand}">
                        </core:InvokeCommandAction>
                    </core:EventTriggerBehavior>
                </interactivity:Interaction.
            </common:SfRichTextBoxAdv>

What am I doing wrong and how can I fix it?


1 Reply

VM Venkatesan Mani Syncfusion Team December 18, 2017 12:35 PM UTC

Hi Khawar Nadeem,

Thank you for contacting Syncfusion support.

By default, the SfRichTextBoxAdv control virtualizes the page on demand and helps reduce the initial load time and memory consumption when working with large size documents. You can disable the virtualization of SfRichTextBoxAdv control by setting IsVirtualizing property as false, to experience scrolling and zooming as smoother and rapid. 
 
Please refer the following example code to disable the virtualization. 
XAML: 
<!-- Defines the SfRichTextBoxAdv control with virtualization disabled. -->  
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv" IsVirtualizing="False"/> 
 
 
C#: 
// Creates new instance of the SfRichTextBoxAdv control.SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();// Disables the virtualization of the SfRichTextBoxAdv control.richTextBoxAdv.IsVirtualizing = false;  
 
VB: 
' Defines the SfRichTextBoxAdv control with virtualization disabled. 
Dim richTextBoxAdv As New SfRichTextBoxAdv() 
' Disables the virtualization of the SfRichTextBoxAdv control.
richTextBoxAdv.IsVirtualizing = False 
 
 
Please refer the following example code to disable the virtualization specific Windows 10 Mobile. 
C#: 
// Creates new instance of the SfRichTextBoxAdv control.SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();// Determines whether the application is running on Windows Mobile.
if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily.Equals("Windows.Mobile", StringComparison.CurrentCultureIgnoreCase)) 
{ 
      // Disables the virtualization of the SfRichTextBoxAdv control, specific to Windows Mobile.      richTextBoxAdv.IsVirtualizing = false;}
  VB: 
' Defines the SfRichTextBoxAdv control with virtualization disabled. 
Dim richTextBoxAdv As New SfRichTextBoxAdv() 
' Determines whether the application is running on Windows Mobile.
If Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily.Equals("Windows.Mobile", StringComparison.CurrentCultureIgnoreCase) Then 
      ' Disables the virtualization of the SfRichTextBoxAdv control, specific to Windows Mobile.       richTextBoxAdv.IsVirtualizing = False  End If 
    Please refer the following MSDN reference link, to create mobile specific designer file (XAML).  https://docs.microsoft.com/en-us/windows/uwp/design/layout/layouts-with-xaml#tailored-layouts    Please make use of the following tips to enable/disable virtualization of SfRichTextBoxAdv control. 
Enable virtualization  Disable virtualization 
1.       Efficient for large size documents. 
2.       Reduce initial loading time for large size documents. 
3.       Scrolling and zooming experience will be smoother, with a reasonable UI refresh time based on the document content size. 
4.       Memory utilization is optimal, to process large size documents. Since UI elements will be alive only for the visible contents. 

1.       Efficient for small size documents. 
2.       Initial loading time will be reasonable based on the document content size. 
3.       Scrolling and zooming experience will be smoother, without any dependency on the document content size. 
4.       Memory utilization may increase rapidly for large size documents. Since UI elements will be alive for all the contents. 


Regards,
Venkatesan M. 

Loader.
Up arrow icon