eduoliveros
11/27/2017 - 7:00 PM

false flag linker

engañar al linker para añadir los eventos que se usan por introspección. Se pone en ViewDidLoad (donde están los binds)

//clase
private static bool _falseFlag = false;

//en ViewDidLoad, por ejemplo, o una clase externa.
#region Subscribing to events to avoid linker issues in release mode

// This "fools" the linker into believing that the events are used.
// In fact we don't even subscribe to them.
// See https://developer.xamarin.com/guides/android/advanced_topics/linking/

if (_falseFlag)
{
    MyTextFieldB1.EditingChanged += (s, e) =>
    {
    };
    MySwitchC1.ValueChanged += (s, e) =>
    {
    };
}

#endregion