My MvvmCross Android app which was working before now is broken because of MvvmCross update from 4.2.3 to 4.4.0
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxBind="Text Login" />
public string Login
{
get { return _login; }
set { SetProperty(ref _login, value); }
}
LinkerPleaseInclude if of course there:
public void Include(EditText text)
{
text.Enabled = !text.Enabled;
text.TextChanged += (sender, args) => text.Text = "" + text.Text;
text.Hint = "" + text.Hint;
text.Click += (s, e) => text.Visibility = text.Visibility - 1;
}
public void Include(TextView text)
{
text.TextChanged += (sender, args) => text.Text = "" + text.Text;
text.Hint = "" + text.Hint;
text.Click += (s, e) => text.Text = text.Text + "";
}
Linker "SDK Only" enabled. For disabled linker it works fine. Other bindings works fine as well (button clicks, visibilities, etc).
How to tell linker to handle this properly? What could be wrong here?
The binding target for EditText
and TextView
uses the AfterTextChanged
event, which probably gets linked away. Add that to your Include methods instead of TextChanged
and it should work:
public void Include(TextView text)
{
text.AfterTextChanged += (sender, args) => text.Text = "" + text.Text;
text.Hint = "" + text.Hint;
text.Click += (s, e) => text.Text = text.Text + "";
}
I don't think you need a separate method for EditText
as EditText
inherits from TextView
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With