Search code examples
silverlight-4.0scrollbarbusiness-application

Scroll Bar Not Showing in Business App - Cosmopolitan Theme


Here is the style from the Styles.xaml.

<Style x:Key="PageScrollViewerStyle" TargetType="ScrollViewer">
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="0,1,0,1"/>
    <Setter Property="Margin" Value="-58,-15,-58,-15"/>
    <Setter Property="Padding" Value="58,0,58,0"/>
    <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
</Style>

Regardless of the size of the browser window, nor if I set the values to "Visible" I am not presented with a scroll bar. Any suggestions on how to correct this?


Solution

  • I was fiddling with this and decided to try changing the order of the LayoutRoot Grid and the ScrollViewer and this seems to have fixed it.

    I changed

    <Grid x:Name="LayoutRoot" DataContext="{StaticResource ViewModel}">
    <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">
    ...
    </ScrollViewer>
    </Grid>
    

    to this:

    <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">
    <Grid x:Name="LayoutRoot" DataContext="{StaticResource ViewModel}">
    ...
    </Grid>
    </ScrollViewer>