scrollbars on dockable content, arrows too close together

Mar 22, 2011 at 12:23 AM

For some reason my scrollbars are misbehaving, see image:

There is plenty of info to scroll through, but the arrows are shown close together and give no indication where the current scroll position is.

 

Here is the XAML for the dockable content:

<ad:DockableContent x:Class="Strive.WPF.LogView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
             Title="Log View" Height="300" Width="300">
    <Grid>
        <Grid.Resources>
            <AlternationConverter x:Key="BackgroundConverter">
                <SolidColorBrush>White</SolidColorBrush>
                <SolidColorBrush>HoneyDew</SolidColorBrush>
                <SolidColorBrush>AliceBlue</SolidColorBrush>
            </AlternationConverter>

            <Style x:Key="alternatingWithBinding" TargetType="{x:Type ListViewItem}">
                <Setter Property="Background" 
                        Value="{Binding RelativeSource={RelativeSource Self},
                              Path=(ItemsControl.AlternationIndex),
                              Converter={StaticResource BackgroundConverter}}"/>
            </Style>
        </Grid.Resources>

        <ListView Name="listView1" AlternationCount="3" ItemsSource="{Binding Path=LogModel.LogEntries}"
                  ItemContainerStyle="{StaticResource alternatingWithBinding}"/>
    </Grid>
</ad:DockableContent>

Any tips?

Nov 12, 2012 at 3:16 AM

Hate necroing a thread over a year old, but I had the same issue and have been struggling to find a solution all day, and figured others may want to know what it was.

It turned out that it was down to the window being initialized while in a hidden state - I was doing this in order to display a custom splash screen window, then showing the main window after everything had loaded.   As a workaround, I'm now minimizing the window instead of hiding it, and my scrollbars are now working fine.