private NotificationProfile(Type type, NotifyPropertyChangedAttribute behavior)
        {
            _dependencyMode = behavior.DependencyMode;

            var properties = type.GetProperties();

            _ignores = (from property in properties
                        where property.GetAttributes<DoNotNotifyAttribute>(true).Any()
                        select property.Name).ToList();

            var dependents = from property in properties
                             let dependencies = property.GetAttributes<DependenciesAttribute>(true)
                             where dependencies.Any()
                             from dependency in dependencies
                                 .SelectMany(x => x.Dependencies)
                                 .Distinct()
                             select new
                             {
                                 Property = property.Name,
                                 DependsOn = dependency
                             };

            foreach (var dependent in dependents)
            {
                GetOrCreateDependencies(dependent.DependsOn)
                    .Add(dependent.Property);

                if (!_recorded.Contains(dependent.Property))
                    _recorded.Add(dependent.Property);
            }
        }
 /// <summary>
 /// Sets the default dependency mode for INPC proxies.
 /// </summary>
 /// <param name="mode">The mode.</param>
 /// <returns>The configuration.</returns>
 public PresentationFrameworkConfiguration SetDefaultDependencyMode(DependencyMode mode)
 {
     NotifyPropertyChangedAttribute.DefaultDependencyMode = mode;
     return(this);
 }
Beispiel #3
0
 internal PackageInfo(string id, DependencyMode mode, IDictionary <string, string> paths = null)
 {
     Id             = id;
     DependencyMode = mode;
     _paths         = paths ?? new Dictionary <string, string>();
 }
Beispiel #4
0
 private Dependency(DependencyMode type)
 {
     Mode = type;
 }