■ ScrollViewer 클래스의 IsDeferredScrollingEnabled 속성을 사용해 스크롤 성능을 높이는 방법을 보여준다.
▶ MainWindow.xaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<Window x:Class="TestProject.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="800" Height="600" Title="ScrollViewer 클래스 : IsDeferredScrollingEnabled 속성을 사용해 스크롤 성능 높이기" FontFamily="나눔고딕코딩" FontSize="16"> <ScrollViewer IsDeferredScrollingEnabled="True"> <StackPanel Name="stackPanel"> <Button Margin="10" Height="100" Background="Red" Content="버튼 1" /> <Button Margin="10" Height="100" Background="Green" Content="버튼 2" /> <Button Margin="10" Height="100" Background="Blue" Content="버튼 3" /> <Button Margin="10" Height="100" Background="Red" Content="버튼 4" /> <Button Margin="10" Height="100" Background="Green" Content="버튼 5" /> <Button Margin="10" Height="100" Background="Blue" Content="버튼 6" /> <Button Margin="10" Height="100" Background="Red" Content="버튼 7" /> <Button Margin="10" Height="100" Background="Green" Content="버튼 8" /> <Button Margin="10" Height="100" Background="Blue" Content="버튼 9" /> </StackPanel> </ScrollViewer> </Window> |