private static void PropertyChanged(BindableObject b, object o, object n) { if (!(b is View view)) { return; } var effect = view.Effects.FirstOrDefault(e => e is TouchEffect); if (GetColor(b) != Color.Default || GetTap(b) != null || GetLongTap(b) != null || GetStartTap(b) != null || GetFinishTap(b) != null) { view.InputTransparent = false; if (effect != null) { return; } var commandEffect = new TouchEffect(); view.Effects.Add(commandEffect); if (ConfigTouch.AutoChildrenInputTransparent && b is Layout && !ConfigTouch.GetChildrenInputTransparent(view)) { ConfigTouch.SetChildrenInputTransparent(view, true); } } else { if (effect == null || view.BindingContext == null) { return; } view.Effects.Remove(effect); if (ConfigTouch.AutoChildrenInputTransparent && b is Layout && ConfigTouch.GetChildrenInputTransparent(view)) { ConfigTouch.SetChildrenInputTransparent(view, false); } } }
public static void Preserve() { ConfigTouch.Preserve(); TouchEffect.Preserve(); }
public static void Init() { ConfigTouch.Init(); TouchEffect.Init(); }