Hi Angelru-4290,
Welcome to our Microsoft Q&A platform!
I mean you can try another alternative, which is to create a separate Property for each behavior.
public static readonly BindableProperty MaxLengthReachedBehaviorProperty = BindableProperty.Create(nameof(EntryBehavior), typeof(EntryBehavior), typeof(MaxLengthReachedBehavior), null, BindingMode.OneTime);
public MaxLengthReachedBehavior EntryBehavior
{
get => (MaxLengthReachedBehavior)GetValue(MaxLengthReachedBehaviorProperty);
set => SetValue(MaxLengthReachedBehaviorProperty, value);
}
add behavior,
private void AddBehavior()
{
MaxLengthReachedBehavior maxBehavior = new MaxLengthReachedBehavior();
maxBehavior.MaxLengthReached += MaxBehavior_MaxLengthReached;
testEntry.MaxLength = 10;
testEntry.EntryBehavior = maxBehavior;
}
private void MaxBehavior_MaxLengthReached(object sender, MaxLengthReachedEventArgs e)
{
}
Regards,
Kyle
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.