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