Exemplo n.º 1
0
 protected override void OnDetached()
 {
     try
     {
         _thisSwitch.CheckedChange -= MySwitch_CheckedChange;
         _thisSwitch = null;
     }
     catch { }
 }
Exemplo n.º 2
0
 protected override void OnAttached()
 {
     try
     {
         _thisSwitch = Control as global::Android.Support.V7.Widget.SwitchCompat;
         if (_thisSwitch != null)
         {
             ChangeColor();
             _thisSwitch.CheckedChange += MySwitch_CheckedChange;
         }
     }
     catch (Exception ex)
     {
         Logger.WriteError(ex);
     }
 }