Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

ListViewRenderer dataSource is null

$
0
0

I've been trying to copy the iOS CostomRenderer from IncredibleWeb/Xamarin-Forms-Chat-Client.
The Exception cause is a nullReferenceException, but i've traced the issue to this line:

table.Source = new ListViewDataSourceWrapper(this.GetFieldValue<UITableViewSource>(typeof(ListViewRenderer), "dataSource"));

where GetFieldValue looks like this:

public static T GetFieldValue<T>(this object @this, Type type, string name) {
            var field = type.GetField(name, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);
            return (T)field.GetValue(@this);
        }

the field ist what is null and causes the exception to be thrown.

Just before the point of failure, the field also gives this error:

Unable to cast object of type 'System.RuntimeType' to type 'Mono.Debugger.Soft.TypeMirror'.

Googleing this error has yielded no enlightenment.
Values before Error

I am completely at a loss here and don't know which parts of the code might be helpful to figuer this out.!

Any help would be greatly appreciated!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>