/// <summary>
 /// Registers the specified event of the target object as a trigger that will cause the target's data to be persisted.
 /// </summary>
 /// <example>
 /// For a Window object, "LocationChanged" and/or "SizeChanged" would be appropriate.
 /// </example>
 /// <remarks>
 /// Automatically persist a target object when it fires the specified name.
 /// </remarks>
 /// <param name="eventNames">The names of the events that will cause the target object's data to be persisted.</param>
 /// <returns></returns>
 public TrackingConfiguration PersistOn(params string[] eventNames)
 {
     foreach (string eventName in eventNames)
     {
         PersistTriggers.Add(new Trigger(eventName, s => s));
     }
     return(this);
 }
        internal TrackingConfiguration(TrackingConfiguration baseConfig, Type targetType)
        {
            TargetType = targetType;
            Tracker    = baseConfig.Tracker;

            idFunc = baseConfig.idFunc;

            appliedAction            = baseConfig.appliedAction;
            persistedAction          = baseConfig.persistedAction;
            applyingPropertyAction   = baseConfig.applyingPropertyAction;
            persistingPropertyAction = baseConfig.persistingPropertyAction;

            foreach (var kvp in baseConfig.TrackedProperties)
            {
                TrackedProperties.Add(kvp.Key, kvp.Value);
            }
            PersistTriggers.AddRange(baseConfig.PersistTriggers);

            ReadAttributes();
        }
 /// <summary>
 /// Automatically persist a target object when the specified eventSourceObject fires the specified event.
 /// </summary>
 /// <param name="eventName">The name of the event that should trigger persisting stete.</param>
 /// <param name="eventSourceGetter"></param>
 /// <returns></returns>
 public TrackingConfiguration PersistOn(string eventName, Func <object, object> eventSourceGetter)
 {
     PersistTriggers.Add(new Trigger(eventName, target => eventSourceGetter(target)));
     return(this);
 }