0

I have an ItemsControl wrapped in a ScrollViewer. The ScrollViewer behaves correctly but does not display correctly:

scrollviewer problem

I have no Styling for ScrollViewer anywhere in my app.

The bar size looks like 0px, so the arrows end up touching.

This happens with every ScrollViewer enclosing an ItemsControl in my app.

I tested a simple ItemsControl to remove possibility of other style information effecting it:

<ScrollViewer VerticalScrollBarVisibility="Visible">
    <ItemsControl>
        <TextBlock Text="test"/>
        <TextBlock Text="test"/>
        <TextBlock Text="test"/>
    </ItemsControl>
</ScrollViewer>

and the result was the same. I also wrapped ItemsControl in a WrapPanel and set Min/Max Heights on the ScrollViewer and WrapPanel and there was no change.

Does anyone know why this is happening and how I can fix it?

Edit: I looked at the ScrollViewer with snoop and the bizarrely Snoop's ScrollViewers also displayed incorrectly (no track bar):

Snoop scrollviewer

Thanks

user13070
  • 511
  • 1
  • 5
  • 14
  • Have you try to set the scrollviewer height in the xaml? – michele Aug 07 '12 at 09:34
  • Yes, I said in my question I set heights on the ScrollViewer and WrapPanel and there was no change. Also, they used to display correctly without specifying Height – user13070 Aug 07 '12 at 09:39
  • Sorry, I totally missed the row where you said it! ;) – michele Aug 07 '12 at 09:45
  • 1
    Can you please post the outer XAML? outside of scrollviewer – Bas Aug 07 '12 at 10:42
  • How are you controlling the layout on your page, a grid? It looks like the scroll viewer might be stuck in a small grid cell or something, maybe you need to set the RowSpan property. – Eamonn McEvoy Aug 07 '12 at 10:48
  • In this case of 'nothing is working as it should', i usually create a new blank project, then i try things (here, the ScrollViewer), then i put one by one parts of my project inside the blank project until it breaks, so i know what wrong. – GameAlchemist Aug 07 '12 at 11:29
  • 1
    Have you used [snoop](http://snoopwpf.codeplex.com/) to examine the `ScrollViewer`? It can be very helpful, particularly when debugging visual issues like this. – Brian S Aug 07 '12 at 11:46
  • @BrianS thanks for that tip, really great tool. I didn't fully understand what I was looking for but it looked like the height of the tracker bar is 0px. However the strange thing was that snoop's ScrollViewer's actually displayed incorrectly as they do in my app.. i've updated my question to show this. – user13070 Aug 08 '12 at 08:42
  • haha look at Snoop's background logo in the bottomright it's a dog smelling poop haha! (sorry I couldn't resist) – mtijn Aug 09 '12 at 08:03

0 Answers0