mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-16 06:06:36 +08:00
feat: update per copilot review.
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user