even qubuss give the correct answer I like to answer this question with example to make it more clear
lets consider we have a page
this reference parent context
x:Class="Your_Class_Name">
// this come from item source
/DataTemplate>
your view Model should look like that
public class ViewModelName
{
private List _listSource = new List();
public List ListSource
{
get => _listSource;
set
{
_listSource = value;
RaisePropertyChanged();
}
}
public ICommand CommandFromParent => new Command(HandleYourActionHere);
}
}
small Explanation of what happen , when we write BindingContext.CommandFromParent BindingContext represent BindingContext of firstPage(x:Name="firstPage") which be ViewModelName