fix: fix invisible issue when Dot=True & fix some style issues in Badge.
This commit is contained in:
@@ -3,18 +3,19 @@ using Avalonia.Data.Converters;
|
||||
|
||||
namespace Ursa.Converters;
|
||||
|
||||
public class BadgeContentOverflowConverter: IMultiValueConverter
|
||||
public class BadgeContentOverflowConverter : IMultiValueConverter
|
||||
{
|
||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
string overflowMark = parameter is string s ? s : "+";
|
||||
if (double.TryParse(values[0]?.ToString(), out var b) && values[1] is int i and > 0)
|
||||
var overflowMark = parameter as string ?? "+";
|
||||
if (double.TryParse(values[0]?.ToString(), out var b) && values[1] is int count and > 0)
|
||||
{
|
||||
if (b > i)
|
||||
if (b > count)
|
||||
{
|
||||
return i + overflowMark;
|
||||
return $"{count}{overflowMark}";
|
||||
}
|
||||
}
|
||||
|
||||
return values[0];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user