Zen.Wpf.Scoll 0.1.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Zen.Wpf.Scoll --version 0.1.0
                    
NuGet\Install-Package Zen.Wpf.Scoll -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zen.Wpf.Scoll" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zen.Wpf.Scoll" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Zen.Wpf.Scoll" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zen.Wpf.Scoll --version 0.1.0
                    
#r "nuget: Zen.Wpf.Scoll, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zen.Wpf.Scoll@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zen.Wpf.Scoll&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Zen.Wpf.Scoll&version=0.1.0
                    
Install as a Cake Tool

🌀 Zen.Scroll

NuGet Version NuGet Downloads

Zen.Scroll 是一个轻量级滚动动画功能实现库,为 ScrollViewer 及其派生控件(如 ListView、DataGrid、GridView 等)提供流畅的滚动动画效果。它通过附加属性以启用滚动动画,让滚动体验更加自然、顺滑,并且支持触控板滚动处理。

✨ 功能特性

  • 🖱️ 平滑滚动动画:基于 Cubic Bezier 物理缓动函数,提供自然的滚动反馈。
  • ⚡ 高性能:使用 UnitBezier 和动态时长计算,滚动响应迅速。
  • 🛠️ 灵活配置:通过附加属性 ScrollAnimation.IsEnabled 可单独控制每个 ScrollViewer 的开关。

📦 安装

通过 NuGet 包管理器安装:

dotnet add package Zen.Wpf.Scroll

或使用 Visual Studio 的 NuGet 包管理器搜索 Zen.Wpf.Scroll 安装


🚀 快速开始

1. 在 App.xaml 中全局启用

通过在 Application.Resources 中添加 默认样式覆盖 并设置 启用滚动动画:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            
        </ResourceDictionary.MergedDictionaries>

        
        <Style BasedOn="{StaticResource {x:Type ScrollViewer}}" TargetType="ScrollViewer">
            <Setter Property="ScrollAnimation.IsEnabled" Value="true" />
        </Style>

        <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}"
               BasedOn="{StaticResource {x:Static GridView.GridViewScrollViewerStyleKey}}"
               TargetType="ScrollViewer">
            <Setter Property="ScrollAnimation.IsEnabled" Value="true" />
        </Style>
    </ResourceDictionary>
</Application.Resources>

2. 直接应用于单个控件

如果你只想在特定控件上启用动画,可以直接设置附加属性:

<ScrollViewer ScrollAnimation.IsEnabled="True">
    
</ScrollViewer>

3. 控件级样式

也可以通过显式样式应用(避免被其它样式覆盖):

<Style x:Key="MyScrollViewerStyle" TargetType="ScrollViewer">
    <Setter Property="ScrollAnimation.IsEnabled" Value="true" />
</Style>

📝 许可证

本项目采用 Apache License 2.0 许可证,详情请参阅 LICENSE 文件。

🙏 致谢

本项目的滚动动画缓动算法参考了 WebKit 开源项目中的 UnitBezier.h 实现(采用 BSD 2-Clause 许可证)。并在其基础上进行了移植和适配,使其适用于 WPF 的滚动动画场景。

感谢 Apple Inc. 和 WebKit 贡献者 的杰出工作,让我们能够借鉴其成熟的计算方法,实现了流畅的滚动体验。

相关引用:

Enjoy smooth scrolling! 🌀

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated