This project has moved and is read-only. For the latest updates, please go here.

TreeViewItem.Expanded and EventToCommand

Jul 15, 2010 at 1: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 8:29 AM
Edited Jul 24, 2010 at 8:29 AM

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