function dispatchPropertyChange(target, propertyName, newValue, oldValue) {
    let e = new Event(propertyName + 'Change');
    e.propertyName = propertyName;
    e.newValue = newValue;
    e.oldValue = oldValue;
    target.dispatchEvent(e);
  }
Fires a property change event on the target.
@param {EventTarget} target The target to dispatch the event on.
@param {string} propertyName The name of the property that changed.
@param {*} newValue The new value for the property.
@param {*} oldValue The old value for the property.