Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Scrollbars and HeaderedContentControl

$
0
0

I'm just learning WPF (finally) and I'm trying to get scrollbars to work in the content part of a HeaderedContentControl. I seem to get the horizontal scrollbar correctly, but the vertical scrollbar never appears.

Here's my xaml:

<Window x:Class="WpfApplication1.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300"><HeaderedContentControl ><HeaderedContentControl.Header><TextBlock Text="This is the header" /></HeaderedContentControl.Header><HeaderedContentControl.Content><ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"><Grid><Grid.RowDefinitions><RowDefinition Height="Auto" /></Grid.RowDefinitions><Ellipse Grid.Row="0" Height="250" Width="250" Fill="DeepSkyBlue" /></Grid></ScrollViewer></HeaderedContentControl.Content></HeaderedContentControl></Window>

If I remove the HeaderedContentControl elements and just leave the ScrollViewer element (and it's contents), it all works as I would expect.

What is it about the HeaderedContentControl.Content that it doesn't want to play nicely with the ScrollViewer, and how do I get it to play nicely?

Thanks,

Mark


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>