Hi and thanks for looking!
Background
I have made a simple little app in WPF that has a grid layout consisting of one column and two rows. The top row holds a simple label for the header, and the bottom row holds a wrappanel that is dynamically populated with image thumbnails at runtime. Here is the XAML:
<Window x:Class="HTNavigator.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" WindowState="Maximized" WindowStyle="None">
<Window.Background>
<ImageBrush ImageSource="/HTNavigator;component/Images/HNBG.jpg" />
</Window.Background>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="75"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" Height="50" HorizontalAlignment="Left" Margin="30,10,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="Auto" FlowDirection="LeftToRight" Orientation="Horizontal" >
<Label Content="Home Navigator v0.1" FontFamily="Tahoma" FontSize="18" FontWeight="Bold" Foreground="White" />
<Button Content="Close" Height="50" Click="Button_Click"></Button>
</StackPanel>
<ScrollViewer Grid.Row="1" Name="MyScrollViewer" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<WrapPanel HorizontalAlignment="Center" Name="spContainer" VerticalAlignment="Top" ClipToBounds="True"></WrapPanel>
</ScrollViewer>
</Grid>
</Window>
Problem
The scrollbar does not show and mouse-wheel scrolling also does not work. I originally did not use the grid layout, and at that this time this portion of the XAML behaved as expected:
<ScrollViewer Name="MyScrollViewer" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<WrapPanel HorizontalAlignment="Center" Name="spContainer" VerticalAlignment="Top" ClipToBounds="True" ItemHeight="Auto"> </WrapPanel>
</ScrollViewer>
Now everything lays out properly, but I don't get my vertical scroll ability (I do not want horizontal scroll).
Any thoughts?
Thanks!
Matt