Here is the error message I am seeing in the Application output:
Binding: 'GearTapBtnCmd' property not found on 'Memorise.HomeTabPage',
target property: 'Memorise.HomeTabPage.RightIconTapCommand'
HomeTabPage.xaml
<?xml version="1.0" encoding="UTF-8"?>
<t:HeadingScrollableView
PageTitle="Home"
PageTitleVisible="True"
RightIconSource="{DynamicResource GearIcon}"
RightIconTapCommand="{Binding GearTapBtnCmd, Mode=OneWay}"
HomeTabPage.xaml.cs
public partial class HomeTabPage : HeadingScrollableView
{
public HomeTabViewModel vm;
public HomeTabPage()
{
InitializeComponent();
BindingContext = vm = new HomeTabViewModel();
}
HomeTabViewModel
public partial class HomeTabViewModel : BaseViewModel
{
public IAsyncCommand GearTapBtnCmd { get; private set; }
public HomeTabViewModel()
{
GearTapBtnCmd = new MvvmHelpers.Commands.AsyncCommand(OpenPrefAsync);
}
HeadinsScrollableView.xaml
<?xml version="1.0" encoding="UTF-8"?>
<t:HeadingViewBase
Shell.NavBarIsVisible="false"
x:Class="Memorise.Templates.HeadingScrollableView"
x:Name="ContentPage"
xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"
xmlns:t="clr-namespace:Memorise.Templates"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns="http://xamarin.com/schemas/2014/forms" >
<t:HeadingViewBase.Content>
<Grid
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:Reference ContentPage}, Path=RightIconTapCommand}"/>
</Grid.GestureRecognizers>
</Grid>
</t:HeadingViewBase.Content>
</t:HeadingViewBase>
HeadingScrollableView
[ContentProperty(nameof(InnerContent))]
public partial class HeadingScrollableView : HeadingViewBase
{
public HeadingScrollableView()
{
InitializeComponent();
BindingContext = this;
}
public static readonly BindableProperty RightIconTapCommandProperty =
BindableProperty.Create(nameof(RightIconTapCommand),
typeof(AsyncCommand),
typeof(HeadingScrollableView),
default(MvvmHelpers.Commands.Command));
public AsyncCommand RightIconTapCommand
{
get => (AsyncCommand)GetValue(RightIconTapCommandProperty);
private set => SetValue(RightIconTapCommandProperty, value);
}
The warning message appears but the code seems to work. Does anyone have an idea what might be causing the warning message?