The property 'CalculateCommand' was not found in type 'ContentPage' Xamarin Forms

193 Views Asked by At

I have this problem with BindableProperty, I am working on a GPS Project and I cannot find the solution imageFromMyProjectHere

1

There are 1 best solutions below

0
On

It caused by that the CaculateCommand is not the property of ContentPage.

You could access in other page.

Page14: which include the CaculateCommand property.

   public partial class Page14 : ContentPage
{

    public static readonly BindableProperty CaculateCommandProperty = BindableProperty.Create(nameof(CaculateCommand), typeof(Command), typeof(Page14), null, propertyChanged: HandleCaculateCommandChanged);

    private static void HandleCaculateCommandChanged(BindableObject bindable, object oldValue, object newValue)
    {

    }
    public Command CaculateCommand
    {
        get => (Command)GetValue(CaculateCommandProperty);
        set => SetValue(CaculateCommandProperty, value);
    }
     
     //........
}

Page15.cs:

   public partial class Page15 : Page14

Page15 xaml:

  <local:Page14  xmlns:local="clr-namespace:App14" xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"  
           x:Class="App14.Page15"
          CaculateCommand="{Binding CaculateRouteCommand}">

  </local:Page14>