Windows phone 7 确定silverlight列表框何时完成滚动

Windows phone 7 确定silverlight列表框何时完成滚动,windows-phone-7,scrollviewer,Windows Phone 7,Scrollviewer,有人知道一种简单的方法来确定silverlight listbox/scrollviewer在刷卡后何时完成滚动吗 谢谢添加此样式: <Style TargetType="ScrollViewer"> <Setter Property="VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/&g

有人知道一种简单的方法来确定silverlight listbox/scrollviewer在刷卡后何时完成滚动吗

谢谢添加此样式:

<Style TargetType="ScrollViewer">
    <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="ScrollViewer">
            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="ScrollStates">
                        <VisualStateGroup.Transitions>
                            <VisualTransition GeneratedDuration="00:00:00.5"/>
                        </VisualStateGroup.Transitions>
                        <VisualState x:Name="Scrolling">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                <DoubleAnimation Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="NotScrolling">
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Grid Margin="{TemplateBinding Padding}">
                    <ScrollContentPresenter x:Name="ScrollContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    <ScrollBar x:Name="VerticalScrollBar" IsHitTestVisible="False" Height="Auto" Width="5" HorizontalAlignment="Right" VerticalAlignment="Stretch" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{TemplateBinding VerticalOffset}" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" />
                    <ScrollBar x:Name="HorizontalScrollBar" IsHitTestVisible="False" Width="Auto" Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{TemplateBinding HorizontalOffset}" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" />
                </Grid>
            </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

你有没有问过卷轴是否已经到了尽头?
var ScrollingState = FindListBoxStateGroup(listBox, "ScrollStates");
if (ScrollingState != null)
{
    ScrollingState.CurrentStateChanging += (sender, args) =>
    {
        if (args.NewState.Name.Equals("NotScrolling"))
        {

        }
    }
}

public static VisualStateGroup FindVisualState(FrameworkElement element, string name)
{
    if (element == null)
        return null;

    IList groups = VisualStateManager.GetVisualStateGroups(element);
    foreach (VisualStateGroup group in groups)
        if (group.Name == name)
            return group;

    return null;
}