private void SubscribeForNotifications() { Debug.Assert(_notificationToken == null, "_notificationToken must be null before subscribing."); Realm.ExecuteOutsideTransaction(() => { var managedResultsHandle = GCHandle.Alloc(this); _notificationToken = Handle.Value.AddNotificationCallback(GCHandle.ToIntPtr(managedResultsHandle), NotificationsHelper.NotificationCallback); }); }
private void SubscribeForNotifications() { Debug.Assert(_keyNotificationToken == null, "_keyNotificationToken must be null before subscribing."); Realm.ExecuteOutsideTransaction(() => { var managedResultsHandle = GCHandle.Alloc(this); _keyNotificationToken = _dictionaryHandle.AddKeyNotificationCallback(GCHandle.ToIntPtr(managedResultsHandle)); }); }