internal sealed override void Seal()
{
if (IsSealed)
{
return;
}
// Process the _setters collection: Copy values into PropertyValueList and seal the Setter objects.
ProcessSettersCollection(_setters);
// Freeze the value for the trigger
StyleHelper.SealIfSealable(_value);
// Build conditions array from collection
TriggerConditions = new TriggerCondition[] {
new TriggerCondition(
_binding,
LogicalOp.Equals,
_value) };
// Set Condition for all data triggers
for (int i = 0; i < PropertyValues.Count; i++)
{
PropertyValue propertyValue = PropertyValues[i];
propertyValue.Conditions = TriggerConditions;
switch (propertyValue.ValueType)
{
case PropertyValueType.Trigger:
propertyValue.ValueType = PropertyValueType.DataTrigger;
break;
case PropertyValueType.PropertyTriggerResource:
propertyValue.ValueType = PropertyValueType.DataTriggerResource;
break;
default:
throw new InvalidOperationException(SR.Get(SRID.UnexpectedValueTypeForDataTrigger, propertyValue.ValueType));
}
// Put back modified struct
PropertyValues[i] = propertyValue;
}
base.Seal();
}