0
I have two pages created on Xamarin.forms
, on the first page I have a list and on the second I have the details of each item selected previously. I send the selected item from the first page to the second through the communication of the two code Behind.
Page where I have the list(Code Behind):
private async void ListViewCats_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var SelectedCat = e.SelectedItem as Models.Cat;
if (SelectedCat != null)
{
await Navigation.PushAsync(new Views.DetailsPage(SelectedCat));
ListViewCats.SelectedItem = null;
}
}
Details page(Code Behind):
Cat SelectedCat;
public DetailsPage(Cat selectedCat)
{
this.SelectedCat = selectedCat;
}
This way I can display the data of this object normally in xaml
. But I want to pass on that value selectedCat
to the ViewModel
of details I created, how can I do this?
Thank you very much, I will analyze the Link I find it difficult to create a txt to make a small manipulation
– DiegoAugusto
Blz, if useful, mark as answer. Your question may be the same as others.
– BrianSouza