private static NSNotification CreateNotification(string notificationName, NativeEventArgs eventArgs) { long eventArgsPtr = eventArgs != null ? eventArgs.NativeHandle : 0; NSDictionary <NSObject, NSObject> userInfo = NSDictionary <NSObject, NSObject> .FromObjectsAndKeys( new [] { NSNumber.FromInt64(eventArgsPtr) }, new [] { (NSString)KEY_EVENTARGS }, 1 ); NSNotification notification = NSNotification.FromName(notificationName, null, userInfo); return(notification); }
public static void Invoke(string notificationName, NativeEventArgs eventArgs) { NSNotification notification = CreateNotification(notificationName, eventArgs); NSNotificationCenter.DefaultCenter.PostNotification(notification); }