I use Reflection
to set the Label.TextProperty.CoerceValue
to my custom delegate (TextProperty.CoerceValue
are null by default)
but when Label text changed, the delegate are not called
the same strategy are apply/tried on Image.SourceProperty
, Entry.TextProperty
all are called successful
is bug or Label.TextProperty
by design will not call CoerceValue delegate?
thank you very much.
Xamarin.Forms 4.3.0.947036
var property = Label.TextProperty;
var coerceValue = property.GetType().GetProperty("CoerceValue", BindingFlags.NonPublic | BindingFlags.Instance);
oldDelegate = coerceValue?.GetValue(property) as BindableProperty.CoerceValueDelegate;
coerceValue?.SetValue(property, (bindable, value) => {
var modified = ModifyValue(value); // simply modify the value if required
return modified
});