Hi guys
I have toyed all morning with this problem. I have a DataBound RadTreeView (with ItemsSource) that displays a Hierarchical data structure.
Because each item is displayed using the hierarchy I have no way of hooking into the "DoubleClick" event on a per-item basis.
After some time, I ended up binding SelectedItem to my ViewModel and hooking into the ItemDoubleClick event like below. Unfortunately this makes the assumption that SelectedItem is fired before ItemDoubleClick. So if possible I would love to know a way to hook into the DoubleClick event, so that I can bind the CommandParameter to the item that was double clicked.
<telerik:RadTreeView x:Name="ServerExplorerTreeView" Grid.Row="1" Margin="0 -2 0 0"
VerticalAlignment="Stretch" Background="{StaticResource LightGrayBackgroundBrush}"
IsLineEnabled="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" IsVirtualizing="True"
SelectionMode="Multiple" IsEditable="True" IsDragDropEnabled="True" ItemsSource="{Binding NavigatorVM.Root.ItemsView.View}"
SelectedItem="{Binding NavigatorVM.SelectedItem,Mode=TwoWay}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="ItemDoubleClick">
<i:InvokeCommandAction Command="{Binding NavigatorVM.ItemDoubleClickedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadTreeView>
I have toyed all morning with this problem. I have a DataBound RadTreeView (with ItemsSource) that displays a Hierarchical data structure.
Because each item is displayed using the hierarchy I have no way of hooking into the "DoubleClick" event on a per-item basis.
After some time, I ended up binding SelectedItem to my ViewModel and hooking into the ItemDoubleClick event like below. Unfortunately this makes the assumption that SelectedItem is fired before ItemDoubleClick. So if possible I would love to know a way to hook into the DoubleClick event, so that I can bind the CommandParameter to the item that was double clicked.
<telerik:RadTreeView x:Name="ServerExplorerTreeView" Grid.Row="1" Margin="0 -2 0 0"
VerticalAlignment="Stretch" Background="{StaticResource LightGrayBackgroundBrush}"
IsLineEnabled="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" IsVirtualizing="True"
SelectionMode="Multiple" IsEditable="True" IsDragDropEnabled="True" ItemsSource="{Binding NavigatorVM.Root.ItemsView.View}"
SelectedItem="{Binding NavigatorVM.SelectedItem,Mode=TwoWay}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="ItemDoubleClick">
<i:InvokeCommandAction Command="{Binding NavigatorVM.ItemDoubleClickedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</telerik:RadTreeView>