From b080f497dc30a9dd37540730bb436f3c3a1d198c Mon Sep 17 00:00:00 2001 From: francois Date: Sun, 11 Nov 2018 21:59:11 +0000 Subject: [PATCH] =Avoid converting ObservableCollection into python list --- src/runtime/converter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/converter.cs b/src/runtime/converter.cs index 799010d32..11c67bf82 100644 --- a/src/runtime/converter.cs +++ b/src/runtime/converter.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Security; +using System.ComponentModel; namespace Python.Runtime { @@ -134,8 +135,8 @@ internal static IntPtr ToPython(object value, Type type) return result; } - if (value is IList && value.GetType().IsGenericType) - { + if (value is IList && !(value is INotifyPropertyChanged) && value.GetType().IsGenericType) + { using (var resultlist = new PyList()) { foreach (object o in (IEnumerable)value)