fix: 更新 Converter 使枚举转变成 Int
This commit is contained in:
parent
f12b2d254a
commit
6657c29c79
|
@ -48,9 +48,9 @@ class StringToEnumConverter
|
||||||
{
|
{
|
||||||
object? ret;
|
object? ret;
|
||||||
var field = value?.ToString();
|
var field = value?.ToString();
|
||||||
if (!string.IsNullOrEmpty(field) && Enum.IsDefined(TargetType, field))
|
if (!string.IsNullOrEmpty(field) && Enum.TryParse(TargetType, field, out var v))
|
||||||
{
|
{
|
||||||
ret = field;
|
ret = v;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue