TreeItem with right-aligned delete button
-
Hi, I'm new to WPF, so please bear with me. I have a tree of objects. For every item on the tree, I'd like to have a delete button that is right-aligned. Here's my best text-based representation: [----------------------------] scene entity 1 x entity 2 x child entity 1 x child entity 2 x entity 3 x [----------------------------] The 'x' represents a delete button, or a small x icon. What's the best way to do this? Thanks!
-
Hi, I'm new to WPF, so please bear with me. I have a tree of objects. For every item on the tree, I'd like to have a delete button that is right-aligned. Here's my best text-based representation: [----------------------------] scene entity 1 x entity 2 x child entity 1 x child entity 2 x entity 3 x [----------------------------] The 'x' represents a delete button, or a small x icon. What's the best way to do this? Thanks!
You can override the TreeViewItem template ?
<Style TargetType="TreeViewItem">
<Setter Property="Template">
<Setter.Value><ControlTemplate TargetType="TreeViewItem"> <StackPanel Orientation="Horizontal"> <TextBox></Button> <Button>X</Button> </StackPanel> </ControlTemplate> </Setter.Value> </Setter>
</Style>