private void ApplyStyle(Style style)
        {
            foreach (var setter in style.Setters.OfType <Setter>())
            {
                var operation = new SetterOperation(this, setter);
                operation.Apply();

                setterOperations.Add(operation);
            }

            foreach (var trigger in style.Triggers)
            {
                var condition = new SetterCondition(this, trigger.Property, trigger.Value);

                foreach (var setter in trigger.Setters)
                {
                    var operation = new ConditionalSetterOperation(condition, new SetterOperation(this, setter));
                    operation.Apply();

                    setterOperations.Add(operation);
                }
            }
        }
		private void ApplyStyle (Style style)
		{
			foreach (var setter in style.Setters.OfType<Setter>()) {
				var operation = new SetterOperation (this, setter);
				operation.Apply ();

				setterOperations.Add (operation);
			}

			foreach (var trigger in style.Triggers) {
				var condition = new SetterCondition (this, trigger.Property, trigger.Value);

				foreach (var setter in trigger.Setters) {
					var operation = new ConditionalSetterOperation (condition, new SetterOperation (this, setter));
					operation.Apply ();
				
					setterOperations.Add (operation);
				}
			}
		}
		public ConditionalSetterBehavior (SetterCondition condition, SetterBehavior behavior)
		{
			Behavior = behavior;
			Condition = condition;
			Condition.GetProperty ("IsMatch").DependencyPropertyValueChanged += HandleIsMatchChanged;
		}
Beispiel #4
0
 public ConditionalSetterOperation(SetterCondition condition, SetterOperation operation)
 {
     this.operation          = operation;
     this.condition          = condition;
     this.condition.Changed += HandleConditionChanged;
 }
		public ConditionalSetterOperation (SetterCondition condition, SetterOperation operation)
		{
			this.operation = operation;
			this.condition = condition;
			this.condition.Changed += HandleConditionChanged;
		}