Hi All, I need to call viewmodel method from customview whenever bindable property changed.
public class CustomPieChart : SupportPieChartExtended
{
public static readonly BindableProperty SelectedValueProperty = BindableProperty.Create(nameof(SelectedValue), typeof(string), typeof(CustomPieChart), null);
public string SelectedValue
{
get { return (string)GetValue(SelectedValueProperty); }
set { SetValue(SelectedValueProperty, value);
}
}
}
I am setting this value from customrenderer of CustomPiechart which I am able to but I need to call a method of viewmodel .
public class PaySlipPageViewModel : BaseViewModel
{
public string SelectedValuesSet
{
get => selectedValuesSet;
set {
SetProperty(ref selectedValuesSet, value);
Hello();}
}
public void Hello(){
{
Console.WriteLine("Hello");
}
}
In the UI
I need to reflect SelectedValuesSet from CustomPieChart Class whenever SelectedValue changed.
Please help