TreeViewItem.Expanded and EventToCommand

Jul 15, 2010 at 12:27 PM

How can I use EventToCommand and TreeViewItem.Expanded?

I've doing somehting like this... (but dosent work)

  <TreeView Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Path= MonitoredDatabases}">
                <HierarchicalDataTemplate ItemsSource="{Binding Queues}">

                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding ServerName}" />
                        <TextBlock Text="\" />
                        <TextBlock Text="{Binding DatabaseName}" />

                            <TextBlock Text="{Binding QueueName}" />

                <i:EventTrigger EventName="TreeViewItem.Expanded">
                    <cmd:EventToCommand Command="{Binding Path=NodeExpanded}"
                                        CommandParameter="Expanded" />

Help really appreciated.


Gary Howlett
Jul 24, 2010 at 7:29 AM
Edited Jul 24, 2010 at 7:29 AM

I think if you want to work with treeview in WPF/SL your best result would come from doing something like this :