Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道在 .xaml 文件中添加它的方法,但我需要在 C# 文件中添加它的方法。谢谢。
您可以在此处找到如何以Thumb编程方式获取。
Thumb
然后只需将处理程序添加到事件:
sliderThumb.DragCompleted += myDragCompletedHandler;
这是我能找到的最简单的解决方案,而不会弄乱该Thumb属性:
slider.AddHandler(Thumb.DragCompletedEvent, new DragCompletedEventHandler((sender, e) => { // Handling code }));