I have a parent ContentPage with several ContentViews in separate files. I am trying to pass as reference an element in the parent ContentView to a CommandParameter in one
You could check the following code
Since you had used Custom ContentView , you need use bindable property to binding value between the elements in ContentView and Parent ContentPage
public static readonly BindableProperty AddressSelectionChangedCommandProperty =
BindableProperty.Create(nameof(AddressSelectionChangedCommand), typeof(ICommand), typeof(AddressChipView));
public ICommand AddressSelectionChangedCommand
{
get => (ICommand)GetValue(AddressSelectionChangedCommandProperty );
set => SetValue(AddressSelectionChangedCommandProperty , value);
}
public static BindableProperty CurrentMapViewProperty =
BindableProperty.Create(nameof(CurrentMapView), typeof(object), typeof(AddressChipView));
public object CurrentMapView
{
get => (object)GetValue(CurrentMapViewProperty );
set => SetValue(CurrentMapViewProperty , value);
}
//... other bindable property
Now you can binding it in ContentPage