From 32eaaa7e03c045576570b5a887d640c97a591673 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Tue, 26 Jun 2018 16:07:38 +0200 Subject: [PATCH 1/2] Remove IList implementation of Realm collections --- CHANGELOG.md | 11 +++++------ Realm/Realm/RealmCollectionBase.cs | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac42b80e47..248548b1fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,14 @@ - Exposed a `ChangeSet.NewModifiedIndices` collection that contains information about the indices of the objects that changed in the new version of the collection (i.e. after accounting for the insertions and deletions). +- Update Fody to 3.0. ### Bug fixes - `WriteAsync` will no longer perform a synchronous `Refresh` on the main thread. ([#1729](https://github.com/realm/realm-dotnet/pull/1729)) - Trying to add a managed Realm Object to a different instance of the same on-disk Realm will no longer throw an exception. +- Removed the `IList` compliance for Realm collections. This fixes an issue which would cause the app to hang +on Android when deselecting an item from a ListView bound to a Realm collection. ### Breaking Changes - `SyncConfiguration` is now deprecated and will be removed in a future version. Two new configuration @@ -18,12 +21,8 @@ and [FullSyncConfiguration](https://docs.realm.io/platform/using-synced-realms/s If you were using a `SyncConfiguration` with `IsPartial = true`, then change your code to use `QueryBasedSyncConfiguration`. Similarly, if `IsPartial` was not set or was set to `false`, use `FullSyncConfiguration`. - -x.y.z (TBD) ------------------- - -### Enhancements -- Update Fody to 3.0. +- Removed the `IList` compliance for Realm collections. This will prevent automatic updates of ListViews +databound to Realm collections in UWP projects. 3.0.0 (2018-04-16) ------------------ diff --git a/Realm/Realm/RealmCollectionBase.cs b/Realm/Realm/RealmCollectionBase.cs index 591c4f94d2..51a67180ab 100644 --- a/Realm/Realm/RealmCollectionBase.cs +++ b/Realm/Realm/RealmCollectionBase.cs @@ -35,7 +35,6 @@ namespace Realms public abstract class RealmCollectionBase : NotificationsHelper.INotifiable, IRealmCollection, - IList, ISchemaSource, IThreadConfined { @@ -413,7 +412,6 @@ public void CopyTo(Array array, int index) var list = (IList)array; foreach (var obj in this) { - list[index++] = obj; } } From 9ed0e27201c4b58bbf771c3cb4741d79b91bdfec Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 27 Jun 2018 13:38:45 +0200 Subject: [PATCH 2/2] Fix build --- Realm/Realm/RealmCollectionBase.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Realm/Realm/RealmCollectionBase.cs b/Realm/Realm/RealmCollectionBase.cs index 51a67180ab..933666b8d1 100644 --- a/Realm/Realm/RealmCollectionBase.cs +++ b/Realm/Realm/RealmCollectionBase.cs @@ -376,8 +376,6 @@ void NotificationsHelper.INotifiable.NotifyCallbacks(NotifiableObjectHandleBase. public object SyncRoot => null; - object IList.this[int index] { get => this[index]; set => throw new NotSupportedException(); } - public virtual int Add(object value) => throw new NotSupportedException(); public virtual void Clear() => throw new NotSupportedException();