using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace commom
{
/// <summary>
/// ScrollViewer触摸滚动
/// 使用用例:
/// 1、xmlns添加引用
/// 2、ScrollViewer添加附加属性设置RollAttachHelper.IsEnabled="True"
/// </summary>
public class RollAttachHelper : DependencyObject
{
public static bool GetIsEnabled(DependencyObject obj)
{
return (bool)obj.GetValue(IsEnabledProperty);
}
public static void SetIsEnabled(DependencyObject obj, bool value)
{
obj.SetValue(IsEnabledProperty, value);
}
public bool IsEnabled
{
get { return (bool)GetValue(IsEnabledProperty); }
set { SetValue(IsEnabledProperty, value); }
}
public static readonly Dependency
WPF ItemControl、ListBox等触摸列表同步滚动条(触摸滚动)
最新推荐文章于 2024-08-14 08:40:54 发布
本文介绍如何在WPF中,针对ItemControl、ListBox等控件,在触摸设备上实现滚动条与内容的同步滚动,确保在触摸操作时用户体验流畅。
摘要由CSDN通过智能技术生成