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); } }
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); }