示例#1
0
 static void AddEffect <T>(Element element) where T : AiRoutingEffectBase
 {
     if (!element.Effects.OfType <T>().Any())
     {
         element.Effects.Add(InstanceCreator <T> .Create());
         EffectShared <T> .SetIsTriggered(element, true);
     }
 }
示例#2
0
        public static void AddEffectHandler <TRoutingEffect>(BindableObject bindable, object oldValue, object newValue) where TRoutingEffect : AiRoutingEffectBase
        {
            if (!EffectConfig.EnableTriggerProperty)
            {
                return;
            }

            if (!(bindable is VisualElement element) || newValue == null)
            {
                return;
            }

            if (EffectShared <TRoutingEffect> .GetIsTriggered(element))
            {
                return;
            }

            AddEffect <TRoutingEffect>(element);
        }