【问题标题】:How to get Scroll offset in RadDataBoundListBox?如何在 RadDataBoundListBox 中获取滚动偏移量?
【发布时间】:2016-07-22 14:26:24
【问题描述】:

当用户尝试在 windows phone 8 silverlight 中滚动 RadDataBoundListbox 时,我们正在尝试查找垂直偏移量。例如:列表框滚动的位置。

到目前为止,我们正在尝试注册 ScrollStateChanged 事件,但该事件仅返回诸如 TopStretch、Scrolling、NotScrolling 等滚动状态。

<telerikPrimitives:RadDataBoundListBox x:Name="MessagesList" IsAsyncBalanceEnabled="True" Style="{StaticResource RadDataBoundListBoxStyle1}">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="ScrollStateChanged">
                            <Command:EventToCommand Command="{Binding ScrollChangedCommand}" PassEventArgsToCommand="True"/>
                        </i:EventTrigger>                           
                    </i:Interaction.Triggers>                        
                </telerikPrimitives:RadDataBoundListBox>

我们找不到任何事件/方法来解决这个问题。

有关解决此问题的任何想法都可能会有所帮助。

谢谢。

【问题讨论】:

    标签: c# wpf windows-phone-8 telerik rad-controls


    【解决方案1】:

    您需要从RadDataBoundListBox 获取ScrollViewer 并直接访问它。 ScrollViewer 在 WP81 和 UWP 中滚动时没有事件,因此您需要创建与 VerticalOffset 属性的绑定并观察其变化。

    【讨论】:

    • 关于如何从 RadDataBoundListBox 获取 ScrollViewer 的任何线索?
    • 看看来自 Coding4Fun 工具包的 VisualTreeHelper 或 TemplatedVisualTreeExtensions.GetFirstLogicalChildByType 方法
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-07
    • 1970-01-01
    • 1970-01-01
    • 2011-07-26
    • 2015-10-09
    相关资源
    最近更新 更多