I have created one custom control for wrappanel.but it shows extra space. so i am trying to create BindableProperty of HeightRequest for control and set it according to content to remove extra space.
this is how i created BindableProperty of HeightRequest
public double HeightRequest { get; set; }
private static BindableProperty heightTextProperty = BindableProperty.Create(
propertyName: "HeightRequest",
returnType: typeof(double),
declaringType: typeof(InstallationPhotoWrappanel),
defaultValue: 100,
defaultBindingMode: BindingMode.TwoWay,
propertyChanged: heightTextPropertyChanged);
private static void heightTextPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
var control = (InstallationPhotoWrappanel)bindable;
control.HeightRequest = Convert.ToDouble(newValue);
}
but it gives me exception
exception has been thrown by the target of an invocation
what i am doing wrong here.please help.
Thank you in advance.