gpt4 book ai didi

Silverlight 3 缺少 ScrollViewer.ScrollChanged 事件解决方法?

转载 作者:行者123 更新时间:2023-12-04 03:55:19 25 4
gpt4 key购买 nike

我希望收到有关 ScrollViewer 垂直滚动条的 VerticalOffset 更改的通知。在 WPF 中有一个 ScrollViewer.ScrollChanged 事件,但在 Silverlight 3 中缺少此事件。有谁知道解决方法?

最佳答案

您可以使用元素绑定(bind),这是一个愚蠢的示例:-

<Grid x:Name="LayoutRoot" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<ScrollViewer x:Name="ScrollSource">
<StackPanel>
<TextBlock>Hello</TextBlock>
<TextBlock>World</TextBlock>
<TextBlock>Yasso</TextBlock>
<TextBlock>Kosmos</TextBlock>
</StackPanel>
</ScrollViewer>
<TextBox Grid.Column="1" Text="{Binding VerticalOffset, ElementName=ScrollSource}" />

</Grid>

作为 ScrollViewer滚动 TextBox 的 Text 属性被告知新值。

关于Silverlight 3 缺少 ScrollViewer.ScrollChanged 事件解决方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1762393/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com