Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Reflection on PCL library

$
0
0

Hi!

I cannot seem to get the reflection API to work with the PCL that targets profile78. The version I'm able to compile is:

    var profile = App.MainPageViewModel.CurrentUserProfile;
    var idProperty = profile.GetType ().GetTypeInfo ().GetDeclaredProperty ("remoteId");

But when I inspect it, the value is null. The version I am able to get the value properly in the "immediate" window is:

    profile.GetType().GetProperty("remoteId")

That fails to compile if I update the current code. What am I doing wrong?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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