private void UpdateFrequentItem() { var dataItem = DataItem; var c = SelectionContainer; var element = AssociatedObject; if (dataItem == null || c == null || element == null) { return; } if (c[dataItem.Id]) { foreach (var setter in _setters.Cast <Setter>()) { element.SetValue(setter.Property, setter.Value); } } }
private static IEnumerable <Setter> MergeSetters(SetterBaseCollection left, SetterBaseCollection right) { if (TryGetNonNull(left, right, out var value)) { return(value?.Cast <Setter>()); } var result = new List <Setter>(right.Cast <Setter>()); foreach (var setter in left.Cast <Setter>()) { if (!result.Any(item => string.IsNullOrEmpty(setter.TargetName) ? Equals(setter.Property, item.Property) : Equals(setter.TargetName, item.TargetName) && Equals(setter.Property, item.Property))) { result.Add(setter); } } return(result); }