A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello,
Welcome to Microsoft Q&A!
The best way is to create a PartialView1ViewModel instance inside ParentPageViewModel , initial and populate data , then you can access the data inside ParentPageViewModel.
For example
public class PartialView1ViewModel
{
public List<Post> Posts { get; set; }
}
public class ParentPageViewModel
{
PartialView1ViewModel model;
public ParentPageViewModel()
{
model = new PartialView1ViewModel { Posts = new List<Post>() };
}
void somewhereYouWantToAccess()
{
var list = model.Posts;
}
}
Thank you.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.