Merge branch 'main' of github.com:jtt-fan/29WxOrder
This commit is contained in:
commit
107bf82f97
31 files changed
+2644
-885
No files matched your search
@@ -53,20 +53,36 @@ namespace _29WxOrderWpf.Converters
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 超出26个字的文本显示省略号
|
||||
/// </summary>
|
||||
public class TextEllipsisConverter26 : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value.ParseToString().Length > 26)
|
||||
return string.Join("", value.ParseToString().Take(26)) + "…";
|
||||
return value.ParseToString();
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException(); // 单向绑定可不实现
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 超出26个字的文本显示省略号
|
||||
/// </summary>
|
||||
public class TextEllipsisConverter26 : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value.ParseToString().Length > 26)
|
||||
return string.Join("", value.ParseToString().Take(26)) + "…";
|
||||
return value.ParseToString();
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException(); // 单向绑定可不实现
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 超出10个字的文本显示省略号
|
||||
/// </summary>
|
||||
public class TextEllipsisConverter8 : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value.ParseToString().Length > 8)
|
||||
return string.Join("", value.ParseToString().Take(8)) + "…";
|
||||
return value.ParseToString();
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException(); // 单向绑定可不实现
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user