Esempio n. 1
0
        public static TriggerCondition Register(FrameworkElement element, DependencyProperty property, object value)
        {
            TriggerCondition condition = new TriggerCondition(element, property, value);

            condition.Register();

            return(condition);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        public static TriggerCondition Register(FrameworkElement element, DependencyProperty property, object value)
        {
            TriggerCondition condition = new TriggerCondition(element, property, value);
            condition.Register();

            return condition;
        }