I have a ContentPage class (Let's call it ClassOne) that contains a public variable:
public string Title { get; set; }
public ClassOne() //Constructor
{
this.InitializeComponent();
BindingContext = this;
}
And its Xaml file has a label which takes info from the Title:
<Label Text="{Binding Title}" TextColor="Red" />
It works if I set the Title property within the class, but I'm trying to pass it from another class that contains this Xaml:
<local:ClassOne Title="example"/>
But it shows an empty label..
How can I pass the string as a xaml property to ClassOne's 'Title' string?