🚩 增加相对路径功能

This commit is contained in:
liufei
2022-06-08 15:52:48 +08:00
parent 7d061abadc
commit 3995084776
8 changed files with 116 additions and 47 deletions

View File

@@ -8,7 +8,10 @@ namespace GeekDesk.Converts
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return null;
if (value == null)
{
value = "";
}
if (parameter == null)
{
return value.ToString();
@@ -16,7 +19,14 @@ namespace GeekDesk.Converts
else
{
string val = value.ToString();
if (string.IsNullOrEmpty(val))
{
return parameter.ToString()
.Replace("\\n", "")
.Replace("{}", "");
}
string param = parameter.ToString();
param = param.Replace("\\n", "\n");
return param.Replace("{}", val);
}
}