Hi,
While I was trying to do a custom button renderer for the XForms Lab's IconButton on Android, I came across a strange beheviour :
When I try to change the button text value, it is overwriten by the renderer :
public class IconButtonRenderer : ButtonRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Button> e)
{
base.OnElementChanged(e);
Control.TextChanged += Control_TextChanged;
Control.SetText("beer", TextView.BufferType.Normal);
Control.Text = "An other beer";
}
void Control_TextChanged(object sender, Android.Text.TextChangedEventArgs e)
{
System.Diagnostics.Debug.WriteLine(e.Text.ToString());
}
}
The SetText() method and the Text setter are overriden later by the original value, it can be easly checked with the Control.TextChanged event handler.
Is that the normal behaviour or is it a bug ?, and if it is normal where am I supposed to call Control.SetText() ?
Thx