Hello,
I have a treeView and I want to bind each item command, command parameter and IsEnabled properties. If I bind just the IsEnabled property it works, but if I add the command binding, the command works, but IsEnabled binding breaks.
I use the following code:
<telerik:RadTreeView ItemsSource="{Binding TreeViewModel.Categories}" Grid.Row="0"> <telerik:RadTreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding SubCategories}"> <StackPanel Orientation="Horizontal"> <TextBlock VerticalAlignment="Center" Text="{Binding Name}" /> </StackPanel> </HierarchicalDataTemplate> </telerik:RadTreeView.ItemTemplate> <telerik:RadTreeView.ItemContainerStyle> <Style TargetType="telerik:RadTreeViewItem" BasedOn="{StaticResource RadTreeViewItemStyle}"> <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/> <Setter Property="Command" Value="{Binding Path=DataContext.GoToTabCommand, RelativeSource={RelativeSource AncestorType=telerik:RadWindow}}" /> <Setter Property="CommandParameter" Value="{Binding Name}" /> </Style> </telerik:RadTreeView.ItemContainerStyle> </telerik:RadTreeView>
How can I make both bindings to work?