mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-03 07:36:34 +08:00
misc: format codes.
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
|
||||
<ControlTheme x:Key="ToggleButtonTreeViewItemIconButton" TargetType="ToggleButton">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
@@ -118,8 +118,7 @@
|
||||
Grid.Column="0"
|
||||
Padding="{DynamicResource TreeViewItemIconMargin}"
|
||||
Focusable="False"
|
||||
IsChecked="{TemplateBinding IsExpanded,
|
||||
Mode=TwoWay}"
|
||||
IsChecked="{TemplateBinding IsExpanded,Mode=TwoWay}"
|
||||
Theme="{StaticResource ToggleButtonTreeViewItemIconButton}" />
|
||||
<ContentPresenter
|
||||
Name="PART_HeaderPresenter"
|
||||
|
||||
@@ -6,20 +6,17 @@ using Avalonia.Data.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
|
||||
public class TreeViewItemIndentConverter: IMultiValueConverter
|
||||
public class TreeViewItemIndentConverter : IMultiValueConverter
|
||||
{
|
||||
public static readonly TreeViewItemIndentConverter Instance = new();
|
||||
|
||||
|
||||
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (values.Count>1 && 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(
|
||||
indent * level,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
return new Thickness(indent * level, 0, 0, 0);
|
||||
}
|
||||
|
||||
return new Thickness(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user