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

Access property in MainActivity.cs (Android) from XAML Portable

$
0
0

Hello guys,

I'm developing a cross-platform application and I need to get the current version of the application, so I made this on MainActivity.cs (Android) :

Context context = this.ApplicationContext;
var version = context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName;

But here's the thing: I have to access "version" from the XAML on the Portable Project to set it on a Label. How can I do this? Any thoughts?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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