I am trying to show a long document (a terms and conditions statement) on a readonly XamRichTextEditor. It is going to be on a Kiosk application so without mouse and keyboard. I want the user to be able to swipe down the screen on the XamRichTextEditor control which will scroll the XamRichTextEditor down. So if the user swiped quickly down it would scroll the XamRichTextEditor control down. Similarly to how you operate a mobile device when scrolling quickly down the screen. As it's difficult to operate the scrollbar on a touchscreen and I want the user to be able to quickly peruse/move through the document.
Not sure if I should use a different control rather than the XamRichTextEditor ?
Thanks.Dave
Hello,
I have been looking into your question and from the provided description I assumed that you require the scroll behavior to be similar to the mobile devices. I prepared a small sample using XamRichTextEditor where I'm handling the TouchMove event and depending on the touch position I'm changing the scroll value.
Please test the attached sample on your side and let me know if I may be of any further assistance. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me along with steps to reproduce. Alternatively, if the behavior cannot be replicated please feel free to provide your own sample. Remove any external dependencies and code that is not directly related to the issue, zip your application and attach it in this case.
Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.
Thank you for your cooperation.
Looking forward to hearing from you.
Sincerely,
Teodosia Hristodorova
Associate Software Developer
5672.XRTE_scroll_on_touch.zip
Thank you Teodosia, is there anyway to prevent the text being selected as you swipe? Also is there anyway for it to scroll quicker depending on how quickly you swipe?
Many thanks.Dave
I have been looking into your questions and having in mind we don't have explicit touch support in the XamRichTextEditor, the default Windows behavior for handling touch events will prevail. In order to prevent the selection, you could handle the SelectionChanged event of the editor and set the event argument DocumentView.Selection range to (0, 0).
However, a better approach I could suggest is to use the ScrollViewer provided by the .NET Framework :
<ScrollViewer PanningMode="VerticalOnly" CanContentScroll="True" > <ig:XamRichTextEditor Name="xrte1" IsReadOnly="True" > <ig:XamRichTextEditor.Document> <ig:RichTextDocument > </ig:RichTextDocument> </ig:XamRichTextEditor.Document> </ig:XamRichTextEditor> </ScrollViewer>
In order to enable the default touch scrolling behavior you could set the ScrollViewer's PanningMode property to value different than its defult which is None. More about this property could be found here.
Additionally, properties that you might consider useful are PanningDeceleration and PanningRatio. As it is mentioned in the Microsoft documentation the PanningRatio property sets the ratio of scrolling offset to translate manipulation offset. Its default value is 1. The PanningDeceleration property specifies the rate the scrolling slows after the user lifts the finger.
I have modified the previously attached sample below. Please test it on your side and let me know if I may be of any further assistance.
2816.XRTE_scroll_on_touch.zip
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,Teodosia HristodorovaAssociate Software Developer
Hi Teodosia, I just pasted the scrollviewer on from your example and it worked really nicely, thank you so much!
Thanks Teodosia, However your sample is exactly the same as the old one? Dave