/// <summary> /// Gets the specified profile for the specified type. /// </summary> /// <param name="type">The type.</param> /// <param name="behavior">The behavior.</param> /// <returns>The profile.</returns> public static NotificationProfile Get(Type type, NotifyPropertyChangedAttribute behavior) { NotificationProfile profile; if(!_profiles.TryGetValue(type, out profile)) { lock(_creationLock) { if(!_profiles.TryGetValue(type, out profile)) { _profiles[type] = profile = new NotificationProfile(type, behavior); } } } return profile; }
/// <summary> /// Initializes a new instance of the <see cref="NotifyPropertyChangedBaseInterceptor"/> class. /// </summary> /// <param name="implementation">The implementation.</param> /// <param name="behavior">The behavior.</param> protected NotifyPropertyChangedBaseInterceptor(Type implementation, NotifyPropertyChangedAttribute behavior) { _profile = NotificationProfile.Get(implementation, behavior); }