
NSScrollViewにはスクロールのイベントはありません。
NSScrollViewのスクロールのイベントを取得するには、NSScrollViewのContentViewの”NSViewBoundsDidChangeNotification”の通知を受け取ります。
NSNotificationCenter.DefaultCenter.AddObserver(
new NSString("NSViewBoundsDidChangeNotification"),
(NSNotification notification) =>
{
var contentView = notification.Object as NSClipView;
var location = contentView.Bounds.Location;
Label.StringValue = new NSString($"location X:{location.X} Y:{location.Y}");
},
ScrollView.ContentView);
サンプルプログラム
Githubからサンプルプログラムをダウンロードできます。