Added reload button and animation
This commit is contained in:
@@ -16,63 +16,70 @@ public class PropertyConfig(PropertyInfo info) {
|
||||
public bool Editable { get; set; } = true;
|
||||
public bool Creatable { get; set; } = true;
|
||||
public bool DisplayValue { get; set; } = true;
|
||||
public bool IsRelation { get; set; }
|
||||
}
|
||||
|
||||
public class PropertyConfig<TProp>(PropertyConfig config) {
|
||||
public PropertyConfig InnerConfig { get; } = config;
|
||||
|
||||
public PropertyConfig<TProp> SetDisplayName(string displayName) {
|
||||
config.Name = displayName;
|
||||
InnerConfig.Name = displayName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> List(bool list) {
|
||||
config.List = list;
|
||||
config.Searchable = false;
|
||||
InnerConfig.List = list;
|
||||
InnerConfig.Searchable = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> Sortable(bool sortable) {
|
||||
config.Sortable = sortable;
|
||||
InnerConfig.Sortable = sortable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> Searchable(bool searchable) {
|
||||
config.Searchable = searchable;
|
||||
InnerConfig.Searchable = searchable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> DisplayedProperty<TInnerProp>(Expression<Func<TProp, TInnerProp>> propertyExpression) {
|
||||
config.DisplayedProperty = TableConfig<TProp>.GetPropertyInfo(propertyExpression);
|
||||
InnerConfig.DisplayedProperty = TableConfig<TProp>.GetPropertyInfo(propertyExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> Format(Func<TProp, string> formatter) {
|
||||
config.Formatter = obj => formatter.Invoke((TProp)obj);
|
||||
InnerConfig.Formatter = obj => formatter.Invoke((TProp)obj);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> ValueParser(Func<string, TProp> parser) {
|
||||
config.Parser = str => parser.Invoke(str)!;
|
||||
InnerConfig.Parser = str => parser.Invoke(str)!;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> ValueTemplate(Func<TProp> template) {
|
||||
config.Template = () => template.Invoke()!;
|
||||
InnerConfig.Template = () => template.Invoke()!;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> Editable(bool editable) {
|
||||
config.Editable = editable;
|
||||
InnerConfig.Editable = editable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> Creatable(bool creatable) {
|
||||
config.Creatable = creatable;
|
||||
InnerConfig.Creatable = creatable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> DisplayValue(bool display) {
|
||||
config.DisplayValue = display;
|
||||
InnerConfig.DisplayValue = display;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PropertyConfig<TProp> IsRelation(bool isRelation) {
|
||||
InnerConfig.IsRelation = isRelation;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user