标签: scrollviewer

ScrollViewer上的动画(平滑)滚动

我有一个ScrollViewer在我的WPF应用程序中,我希望它具有像Firefox一样的平滑/动画滚动效果(如果你知道我在说什么).

我试图通过互联网搜索,我发现的唯一的事情就是:

如何在WPF中创建动画ScrollViewer(或ListBox)

它的工作原理相当不错,但我有一个问题-它的动画滚动效应,但ScrollViewerThumb直接去压点-我希望它是藏汉动画

我怎样才能引起ScrollViewerThumb被藏汉动画,或者是有相同性质/功能,我想工作的控制?

wpf animation scrollviewer

29
推荐指数
1
解决办法
2万
查看次数

如何找到ScrollViewer在WPF中滚动到最后?

ScrollViewer我的自定义控件中有一个实例...我需要scorollview是否滚动到End?有什么办法吗?

wpf scrollviewer

27
推荐指数
2
解决办法
2万
查看次数

触摸在WPF应用程序中滚动ScrollViewer并禁用RealTimeStylus

我们正在开发一个WPF 4.5应用程序,该应用程序将在带有触摸屏监视器的Windows 8计算机上运行.

我们已按照MSDN上的说明禁用对RealTimeStylus的支持,因为我们有一些需要通过WM_TOUCH支持多点触控的视图.

问题是禁用RealTimeStylus支持似乎也会禁用用户使用触摸滚动ScrollViewer的功能 - 通常用户可以用手指平移ScrollViewers,但如果禁用RealTimeStylus支持,则似乎无法执行此操作.ScrollViewer的PanningMode设置为"Both".

是否可以在WPF应用程序中组合这些内容,还是它们是互斥的?

wpf touchscreen scrollviewer windows-8

25
推荐指数
1
解决办法
1476
查看次数

如何在MVVM WPF应用程序中控制ListBox的滚动位置

我有一个大的ListBox启用了垂直滚动,我的MVVM有New和Edit ICommands.我在集合的末尾添加了新项目,但是当我调用MVVM-AddCommand时,我还希望滚动条自动定位到End.我也从应用程序的其他部分创建一个可编辑的项目(通过调用带有特定行项的EditCommand),以便我的ListBoxItem使用DataTrigger进入编辑模式,但是如何将该特定行(ListBoxItem)带到视图中通过调整滚动位置.

如果我在View端进行,我可以调用listBox.ScrollInToView(lstBoxItem).但是从MVVM角度解决这个常见Scroll问题的最佳方法是什么.

c# wpf listbox mvvm scrollviewer

24
推荐指数
3
解决办法
2万
查看次数

如何在C#中查找Scrollviewer的垂直滚动条宽度

我有一个ScrollViewer,我正在显示Vertical Scrollbar,现在我想改变系统的分辨率,我想得到滚动条的宽度.我通过他们提到的One StackOverflow Post来检查SystemParameters.ScrollWidth属性,但我再次找到他们的任何帮助.任何人都可以帮我解决我的问题.任何答案将不胜感激.

c# wpf xaml scrollbar scrollviewer

23
推荐指数
2
解决办法
2万
查看次数

C#WPF - ScrollViewer + TextBlock麻烦

我有一个TextBlock内部的ScrollViewer,与拉伸到其窗口对准.我需要TextBlock表现如下:

  • 使用窗口调整大小,不使用滚动条
  • 当调整大小低于某个宽度时, 应该出现TextBlock保持a MinWidth和滚动条的需要
  • TextWrapping或者TextTrimming应该适当地工作

我该如何获得此功能?

我尝试了几种方法,包括绑定到ActualWidth&ActualHeight,但无法使其工作.

这不是那么困难,我错过了什么?

这是一个放在XamlPad中的代码示例(尚未设置MinWidth):

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <TextBlock TextWrapping="Wrap" Text="Some really long text that should probably wordwrap when you resize the window." />
    </ScrollViewer>
</Window>
Run Code Online (Sandbox Code Playgroud)

.net c# wpf textblock scrollviewer

19
推荐指数
1
解决办法
2万
查看次数

scrollviewer里面的Listview阻止了scrollviewer滚动

我有一个滚动查看器,里面有几个列表框.问题是如果用户使用鼠标中键滚动滚动查看器,而鼠标位于列表视图上方.列表视图将其内部滚动查看器滚动到底部,然后继续捕获鼠标,防止包含滚动查看器滚动.

关于如何处理这个问题的任何想法?

c# wpf listbox scrollviewer

19
推荐指数
4
解决办法
2万
查看次数

让Viewbox和ScrollViewer一起工作

我已经玩了地图,我用它ScrollViewer在地图上移动,我希望ViewBox一起使用它PinchManipulations来放大和缩小地图.到目前为止,我已经通过设置这样做ScrollViewerManipulation模式control,但是这给了我一个滞后,当我放大.有没有办法让这个ViewBoxScrollViewer更好地一起工作,从而避免滞后?我到目前为止的代码是:

ScrollViewer中:

<ScrollViewer Grid.Column ="0"  Width="768" Height="380" HorizontalScrollBarVisibility="Hidden">
    <Viewbox Stretch="None">
        <View:Map/>
    </Viewbox>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)

PinchZoom:

<Grid x:Name="Map" Width="1271" Height="1381.5">

    <Grid.RenderTransform>
        <ScaleTransform ScaleX="{Binding Path=deltaZoom}" ScaleY="{Binding Path=deltaZoom}"/>
    </Grid.RenderTransform>

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="ManipulationStarted">
            <cmd:EventToCommand Command="{Binding Path=ZoomStartedCommand}" PassEventArgsToCommand="True"/>
        </i:EventTrigger>

        <i:EventTrigger EventName="ManipulationDelta">
            <cmd:EventToCommand Command="{Binding Path=ZoomDeltaCommand}" PassEventArgsToCommand="True"/>
        </i:EventTrigger>

        <i:EventTrigger EventName="ManipulationCompleted">
            <cmd:EventToCommand Command="{Binding Path=ZoomCompletedCommand}" PassEventArgsToCommand="True"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>

</Grid>
Run Code Online (Sandbox Code Playgroud)

我使用捏缩放的代码:

public ICommand ZoomStartedCommand { get; set; }
public ICommand ZoomDeltaCommand { get; set; } …
Run Code Online (Sandbox Code Playgroud)

c# zoom scrollviewer visual-studio windows-phone-8

19
推荐指数
1
解决办法
2497
查看次数

如何将WPF ScrollViewer的内容滚动到特定位置

我正在编写自定义WPF ItemsControl以显示项目列表.这些项目显示在ScrollViewer中:

<Style TargetType="MyCustomItemsControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="MyCustomItemsControl">
                    <ScrollViewer x:Name="PART_MyScrollViewer" >
                           <ItemsPresenter/>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
</Style>
Run Code Online (Sandbox Code Playgroud)

我想确保当我将鼠标移动到控件中时,特定项目(标记为已选中)将滚动到鼠标位置.在我的OnMouseEnter方法中,我能够找到该项目,但我不知道下一步该做什么.有谁有想法吗?

protected override void OnMouseEnter(MouseEventArgs e)
{
    for (int i = 0; i < Items.Count; i++)
    {
        ContentPresenter uiElement = (ContentPresenter)ItemContainerGenerator.ContainerFromIndex(i);
        var item = uiElement.Content as MyCustomObject;
        if (item.IsSelected)
        {
            // How to scroll the uiElement to the mouse position?
            break;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

wpf mouse position scrollviewer

18
推荐指数
3
解决办法
3万
查看次数

两个ScrollViewers同步滚动,只要在wpf中滚动任何一个

我已经完成了这个帖子:

将两个VerticalScrollBar绑定到另一个

它几乎有助于实现目标,但仍然缺少一些东西.这是左右或上下移动滚动条给出了我的两个滚动查看器中滚动的预期行为,但是当我们尝试在滚动查看器中滚动使用/单击这些滚动条末端的箭头按钮时,只滚动一个滚动查看器预期的行为.

那么我们需要添加/编辑以解决这个问题呢?

.net c# wpf scrollviewer

16
推荐指数
2
解决办法
2万
查看次数