Example #1
0
        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);
                    }
                }
            }
        }
Example #2
0
        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);
                }
            }
        }
Example #3
0
 public static void Init()
 {
     TouchEffect.Init();
     Commands.Init();
     EffectsConfig.Init();
 }