예제 #1
0
        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);
        }
예제 #2
0
        public static void Invoke(string notificationName, NativeEventArgs eventArgs)
        {
            NSNotification notification = CreateNotification(notificationName, eventArgs);

            NSNotificationCenter.DefaultCenter.PostNotification(notification);
        }