public int GetAutomationPropertyEventCount (AutomationProperty propertyId) { int count = 0; foreach (AutomationPropertyChangedEventTuple evnt in AutomationPropertyChangedEvents) { if (evnt.e.Property.Id == propertyId.Id) count++; } return count; }