페이지 컨트롤의 크기를 설정하면 스크롤 뷰어의 크기가 조정됨에 따라 창의 크기가 조정되지 않습니다. 다음과 같은 코드가있는 경우, 귀하의 scrollviewers 바로 작동하지 않습니다 다음과 같이 단순히 페이지의 높이와 너비 속성을두면
<Page x:Class="SomeNamespace.SamplePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" Title="SamplePage" Height="400" Width="400">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ScrollViewer HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Auto">
<Border x:Name="BigBadBorder" Height="1000" Width="2000" Background="HotPink" Margin="5">
<TextBlock Text="Waldo" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ScrollViewer>
</Grid>
</Page>
, 그것을 잘 작동합니다
<Page x:Class="SomeNamespace.SamplePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" Title="SamplePage">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ScrollViewer HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Auto">
<Border x:Name="BigBadBorder" Height="1000" Width="2000" Background="HotPink" Margin="5">
<TextBlock Text="Waldo" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ScrollViewer>
</Grid>
</Page>
간단한 솔루션에 끝 :
당신을 위해 작동하지 않는 일부 xaml을 올립니다. ScroolView가 컨테이너의 크기까지 채우도록 구성되어 있지 않은 것 같습니다. – Paparazzi
물론, 나는 당신을 위해 샘플을 만들려고 노력하고 있었고 물론 샘플이 효과가있었습니다. 원래 코드가 작동하지 않는 이유와 샘플이 왜 나온지를 보여주는 솔루션을 게시 할 것입니다. – Eric