public Selection <TElementType, TDataType, TParentDataType> ChangeValue <T>(Accessor <T> accessor, Func <TElementType, TDataType, T> valueFunc, OnChangeCallSimple <T> onChangeFunc = null) { Groups.ForEach(group => { @group.Elements.ForEach(element => { TDataType data = (TDataType)element.GetBoundData(); element.GetOrCreateDataBinding().ChangeValue(accessor, valueFunc(element, data), (oldValue, newValue) => onChangeFunc?.Invoke(element, oldValue, newValue)); }); }); return(this); }
public Selection <TElementType, TDataType, TParentDataType> Classed(string ussClass, bool hasClass, OnChangeCallSimple <bool> onChange = null) { ChangeValue(new ClassAccessor(ussClass), hasClass, onChange); return(this); }
public Selection <TElementType, TDataType, TParentDataType> ChangeValue <TValueType>(Accessor <TValueType> accessor, TValueType value, OnChangeCallSimple <TValueType> onChangeFunc = null) { Groups.ForEach(group => { @group.Elements.ForEach(element => { element.GetOrCreateDataBinding().ChangeValue(accessor, value, (oldValue, newValue) => onChangeFunc?.Invoke(element, oldValue, newValue)); }); }); return(this); }