chore: add avalonia Expander demo.

This commit is contained in:
NaBian committed 2025-01-26 14:16:12 +08:00
1 parent 840493b375
commit 99c1effd84
7 files changed
+672 -13

No files matched your search

@@ -9,21 +9,24 @@ public class CornerRadiusSplitConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is CornerRadius cornerRadius)
if (value is not CornerRadius cornerRadius)
{
if (parameter is string str)
{
var arr = str.Split(',');
if (arr.Length != 4) return cornerRadius;
return new CornerRadius(
arr[0].Equals("1") ? cornerRadius.TopLeft : 0,
arr[1].Equals("1") ? cornerRadius.TopRight : 0,
arr[2].Equals("1") ? cornerRadius.BottomRight : 0,
arr[3].Equals("1") ? cornerRadius.BottomLeft : 0);
}
return value;
}
return value;
if (parameter is not string str)
{
return value;
}
var arr = str.Split(',');
if (arr.Length != 4) return cornerRadius;
return new CornerRadius(
arr[0].Trim().Equals("1") ? cornerRadius.TopLeft : 0,
arr[1].Trim().Equals("1") ? cornerRadius.TopRight : 0,
arr[2].Trim().Equals("1") ? cornerRadius.BottomRight : 0,
arr[3].Trim().Equals("1") ? cornerRadius.BottomLeft : 0);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)