I've just started testing the water with WPF and I'm trying to bind the expanded property of an expander and the selected property of a listview item together so that when a list view item is selected the expander expands or going down another road trying to set the listview item to selected on expand of the expander
so far I've got
<ListView HorizontalAlignment="Stretch" Name="listView1" VerticalAlignment="Stretch" SelectionMode="Single" >
<ListView.Resources>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="IsSelected" Value="{Binding Path=IsExpanded, Mode=TwoWay}"/>
</Style>
</ListView.Resources>
<ListView.ItemTemplate>
<DataTemplate>
<Expander>
<TextBlock Text="{Binding Name}"></TextBlock>
</Expander>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
But I can't figure out how to reference the expander in the binding. Any help or a nudge in the right direction would be appreciated.
Thanks