public static TriggerCondition Register(FrameworkElement element, DependencyProperty property, object value) { TriggerCondition condition = new TriggerCondition(element, property, value); condition.Register(); return(condition); }
public override IDataTriggerCondition CreateDataTriggerCondition(FrameworkElement element) { if (Property == null) { throw new Granular.Exception("Trigger.Property cannot be null"); } DependencyProperty dependencyProperty = Property.GetDependencyProperty(element.GetType()); object resolvedValue = Value == null || dependencyProperty.PropertyType.IsInstanceOfType(Value) ? Value : TypeConverter.ConvertValue(Value.ToString(), dependencyProperty.PropertyType, XamlNamespaces.Empty, null); FrameworkElement source = SourceName.IsNullOrEmpty() ? element : NameScope.GetTemplateNameScope(element).FindName(SourceName) as FrameworkElement; return(TriggerCondition.Register(source, dependencyProperty, resolvedValue)); }
public static TriggerCondition Register(FrameworkElement element, DependencyProperty property, object value) { TriggerCondition condition = new TriggerCondition(element, property, value); condition.Register(); return condition; }