private static void PropertyChanged(BindableObject bindable, object oldValue, object newValue) { if (!(bindable is View view)) { return; } var eff = view.Effects.FirstOrDefault(e => e is TouchRoutingEffect); if (GetColor(bindable) != Color.Default) { view.InputTransparent = false; if (eff == null) { view.Effects.Add(new TouchRoutingEffect()); if (EffectsConfig.AutoChildrenInputTransparent && bindable is Layout && !EffectsConfig.GetChildrenInputTransparent(view)) { EffectsConfig.SetChildrenInputTransparent(view, true); } } } else { if (eff != null && view.BindingContext != null) { view.Effects.Remove(eff); if (EffectsConfig.AutoChildrenInputTransparent && bindable is Layout && EffectsConfig.GetChildrenInputTransparent(view)) { EffectsConfig.SetChildrenInputTransparent(view, false); } } } }
static void PropertyChanged(BindableObject bindable, object oldValue, object newValue) { if (!(bindable is View view)) { return; } var eff = view.Effects.FirstOrDefault(e => e is CommandsRoutingEffect); if (GetTap(bindable) != null || GetLongTap(bindable) != null || GetHold(bindable) != null) { view.InputTransparent = false; if (eff != null) { return; } view.Effects.Add(new CommandsRoutingEffect()); if (EffectsConfig.AutoChildrenInputTransparent && bindable is Layout && !EffectsConfig.GetChildrenInputTransparent(view)) { EffectsConfig.SetChildrenInputTransparent(view, true); } } else { if (eff == null || view.BindingContext == null) { return; } view.Effects.Remove(eff); if (EffectsConfig.AutoChildrenInputTransparent && bindable is Layout && EffectsConfig.GetChildrenInputTransparent(view)) { EffectsConfig.SetChildrenInputTransparent(view, false); } } }
public static void Init() { TouchEffect.Init(); Commands.Init(); EffectsConfig.Init(); }