1

So I have come to that point where I am saying to myself over and over again I am missing some basic stuff. I have a ScrollViewer with a RichTextBlock that converts HTML to the content.

Everything shows up as expected but I can't scroll! I had the VerticalScrollBarVisibility to Hidden but I have taken that out. After seeing this anwsear in StackOverflow I have stoped with the following code:

<ScrollViewer VerticalAlignment="Stretch"
    HorizontalScrollMode="Disabled" 
    VerticalScrollBarVisibility="Visible" 
    VerticalScrollMode="Auto"
    ZoomMode="Disabled" 
    Padding="52" 
    Background="#60000000" >

    <RichTextBlock rtbx:Properties.Html="{Binding TextHTML}"
         TextAlignment="Justify" 
         FontSize="20" />

</ScrollViewer>

It also seems that the PanningMode is not avaiable in Windows 8 but I belive that it is still the expected behaviour to scroll with the touch.

I have tried to put the ManipulationMode to All in the ScrollViewer and also tried to set to none in the RichTextBlock. However, I got no sucess with those approaches.

Community
  • 1
  • 1
Tiago Almeida
  • 14,081
  • 3
  • 67
  • 82
  • Do you have a screenshot which show what you get? – Aymeric Jan 08 '13 at 11:39
  • I have text and it shows the scroll on the right. Everything shows as expected. I can scroll using the scroll bar (with a mouse - actually I have some hard time doing that since the RichTextBlock overrides the cursor and I can only select the scroll bar in the right edge) but I can't scroll using the touch. – Tiago Almeida Jan 08 '13 at 11:44
  • I had some troubles with the scrollviewer and text too. If I remember right I had to put a panel inside the scrollviewer and then the text inside the panel – Aymeric Jan 08 '13 at 12:04
  • I have tried to put a `Grid` inside and I had no success :( – Tiago Almeida Jan 08 '13 at 14:58
  • 1
    Your XAML looks ok at first glance. Try to remove manipulationmode from RTB and set ishittestvisible to false. – Denis Jan 08 '13 at 19:44
  • I have removed the ManipulationMode from the RTB and it is the same. With `isHitTestVisible` set to false I cant scroll with the touch OR the mouse. – Tiago Almeida Jan 09 '13 at 09:32

1 Answers1

0

Removing the manipulation modes and isolating the problem and simplifing the "options" I was using led me to the conclusion that the ScrollViewer wasn't the issue.

The problem was: I had was a Control that was on top of the ScrollViewer that was hidden (opacity = 0). This Control swallowed all the events that I was needing in the ScrollViewer. Basic mistake.

I had to put the Visibility equals to Collapsed.

Tiago Almeida
  • 14,081
  • 3
  • 67
  • 82