public Boolean HasOverlappingAssignment(IStyleValueAssignment assignment)
        {
            foreach (var existing in Assignments)
            {
                if (existing.DoOverlap(assignment))
                {
                    return(true);
                }
            }

            return(false);
        }
        private static IStyleValueAssignment GetDefaultAssignment(IStyleValueAssignment exampleAssignment)
        {
            if (!(exampleAssignment is IPropertyValueAssignment propertyValue))
            {
                throw new NotImplementedException();
            }

            var applied = new AppliedValueAssignment(propertyValue.Visual, propertyValue.Property,
                                                     propertyValue.Property.DefaultValue);

            return(applied);
        }
        public void AddDefaultAssignment(IStyleValueAssignment exampleAssignment)
        {
            var applied = GetDefaultAssignment(exampleAssignment);

            Assignments.Add(applied);
        }
示例#4
0
 public Boolean DoOverlap(IStyleValueAssignment other)
 {
     return(other is AppliedValueAssignment applied &&
            applied.Property.Equals(Property));
 }