Hi,
I think settings can be sorted on the UI with Weight / Order property.
We can use like this (code side);
context.Add(
new SettingDefinition(
...
)
.WithProperty(SettingUiConst.Weight, "5")
...
);
or like this (xml side);
"Setting1": {
...
"Weight": "5"
}
Code Example
SettingInfo
public class SettingInfo
{
public short Weight { get; set; }
...
}
Default value can be set zero.
SettingUiAppService
... SetSettingDefinitionPropertiesAsync(...) {
...
// Default weight: 0
if(!si.Properties.ContainsKey(SettingUiConst.Weight))
{
si.WithProperty(SettingUiConst.Weight, "0");
}
...
}
in SettingUiAppService.GroupSettingDefinitions:
settingInfos.OrderByDescending(si => (short) si.Properties[SettingUiConst.Weight]).ToList();
Hi,
I think settings can be sorted on the UI with
Weight / Orderproperty.We can use like this (code side);
or like this (xml side);
Code Example
SettingInfo
Default value can be set zero.
SettingUiAppService
in SettingUiAppService.GroupSettingDefinitions: