Tree nodes without children are shorter than tree nodes with children.

Themes, Shared, and Core Libraries for Avalonia Forum

Posted 1 month ago by Michael Janulaitis - Corner Bowl Software
Avatar

I have a tree view with multiple layers of tree nodes.  Tree nodes without children are shorter than tree nodes with children.  It appears that the Expander has a margin on it which is causing the issue.


Comments (2)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I'm on our v24.2.0 code and am running our Sample Browser's Themes / TreeView sample.  I don't see a difference in height there between expandable and leaf nodes.

Are you seeing the issue in our sample or only in your application?  I'm wondering if you have some Style in your application that is affecting spacing here, perhaps targeting ToggleButtons, since one is within the TreeViewItem template?

If you see the issue in our sample, please let us know how to reproduce it in v24.2.0.  Thanks!


Actipro Software Support

Posted 1 month ago by Michael Janulaitis - Corner Bowl Software
Avatar

Thank you for the reply. I agree the issue is in my code.  I made this change trying to force a square button button not realizing I would hose TreeViews or any other control that has embedded a ToggleButton.

Here's the culprit:

	<Style Selector="ToggleButton">
		<Setter Property="CornerRadius" Value="{actipro:ScaledCornerRadius 0.4}" />
		<Setter Property="MinHeight" Value="32" />
		<Setter Property="Width" Value="{Binding $self.Bounds.Height}" />
	</Style>

Add Comment

Please log in to a validated account to post comments.