0
我有一個PivotControl
包含ListBox
元素:獲取ScrollViewer.VerticalOffset從列表框在PivotControl
<controls:Pivot Title="SECTIONS" x:Name="pivotControl" ItemsSource="{Binding SectionViewModels}">
<controls:Pivot.HeaderTemplate>
<!-- -->
</controls:Pivot.HeaderTemplate>
<controls:Pivot.ItemTemplate>
<DataTemplate>
<StackPanel>
<!-- if you don't explicitly specify the height, the scrolling won't work -->
<ListBox ItemsSource="{Binding StoryViewModels}" SelectionChanged="StoryList_SelectionChanged"
Height="625" u:ScrollViewerMonitor.AtEndCommand="{Binding ElementName=LayoutRoot, Path=DataContext.FetchMoreDataCommand}">
<ListBox.ItemTemplate>
<DataTemplate>
<local:StoryControl />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</DataTemplate>
</controls:Pivot.ItemTemplate>
</controls:Pivot>
我想獲取和設置對應於給定SectionViewModel
一個ListBox
的ScrollViewer.VerticalOffset
(這是項目源樞軸控制)。我怎樣才能做到這一點?