I trying to create a customEntry which calls Unfocus method if MVVM boolean changes to false.
<local:CustomEntry
ChangeFocus="{Binding MyViewModelPropertyVisible}" />
public class CustomEntry : Entry
{
public CustomEntry()
: base()
{ }
public static BindableProperty ChangeFocusProperty = BindableProperty.Create<CustomEntry, bool>(c => c.ChangeFocus, false);
public bool ChangeFocus
{
get
{
return (bool)base.GetValue(ChangeFocusProperty);
}
set
{
if (!value && this.IsFocused) this.Unfocus();
base.SetValue(ChangeFocusProperty, value);
}
}
}
The viewmodel is working properly, the problem is that ChangeFocus Property is not been calling, am I missing something?
Tks