Good day. I have a style with two setters: setter for ControlTemplate and setter for ItemsPanel:
<Style TargetType="TreeViewItem" x:Key="myStyle">
<Setter Property="Template">
<Setter.Value>
<StackPanel>
<ControlTemplate TargetType="TreeViewItem">
<ItemsControl ItemsSource="{Binding Converter={StaticResource myConverter}}"/>
</ControlTemplate>
</StackPanel>
<!--...-->
<ItemsPresenter/>
<!--...-->
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel IsItemsHost="True"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
How can I get the StackPanel or its children collection from ItemsPanel
<StackPanel IsItemsHost="True"/>
to ItemsControl.ItemsSource in the ControlTemplate
<ItemsControl ItemsSource="{Binding Converter={StaticResource myConverter}}"/>
with binding throw myConverter? I can't make the right binding path...
Update:
Ok, it becomes too complicated. My plans go far, but now I need to solve this simple problem only. All I need to do is that binding:
Anybody knows how to write this binding path? Thanks.