Skip to content

Instantly share code, notes, and snippets.

@AizazZaidee
Created February 10, 2020 08:19
Show Gist options
  • Save AizazZaidee/bedf2b91d3903a7d8744fb2536c0dcf8 to your computer and use it in GitHub Desktop.
Save AizazZaidee/bedf2b91d3903a7d8744fb2536c0dcf8 to your computer and use it in GitHub Desktop.
mvvmcross get root viewgroup of top activity's layout
IMvxAndroidCurrentTopActivity topActivity = Mvx.IoCProvider.Resolve<IMvxAndroidCurrentTopActivity>();
ViewGroup viewGroup = topActivity.Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
View view = LayoutInflater.From(topActivity.Activity.ApplicationContext)
.Inflate([Your layout id to inflate], viewGroup, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment