feat: update per copilot review.

This commit is contained in:
Dong Bin
2025-04-14 01:26:10 +08:00
parent 4120f59c90
commit 3c4da0f82c

View File

@@ -8,11 +8,11 @@ namespace Semi.Avalonia.Converters;
public class TreeViewItemIndentConverter: IMultiValueConverter public class TreeViewItemIndentConverter: IMultiValueConverter
{ {
public static TreeViewItemIndentConverter Instance = new(); public static readonly TreeViewItemIndentConverter Instance = new();
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture) public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{ {
if (values[0] is int level && values[1] is double indent) if (values.Count>1 && values[0] is int level && values[1] is double indent)
{ {
return new Thickness( return new Thickness(
indent * level, indent * level,