protected override void OnAttached() { //Store the old color and set the new one SwitchCompat switchCompat = (SwitchCompat)Control; SwitchColorEffect effect = (SwitchColorEffect)Element.Effects.FirstOrDefault(e => e is SwitchColorEffect); oldColor = switchCompat.HighlightColor; switchCompat.SetHighlightColor(effect.Color.ToAndroid()); }
protected override void OnAttached() { //store the old color and set the new one UISwitch uiSwitch = (UISwitch)Control; SwitchColorEffect effect = (SwitchColorEffect)Element.Effects.FirstOrDefault(e => e is SwitchColorEffect); oldColor = uiSwitch.OnTintColor; uiSwitch.OnTintColor = effect.Color.ToUIColor(); }