I have set the datasource for TreeViewAdv and tried to use the context menu and checkbox for treeview items.
<TreeView>
<TreeViewItem Header="TestedApps"
ItemsSource="{Binding Scripts}">
<StackPanel Orientation="Horizontal">
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Header="Play" Click="Play"/>
</ContextMenu>
</StackPanel.ContextMenu>
<CheckBox Margin="0" VerticalAlignment="Center" IsChecked="{Binding IsEnabled, Mode=TwoWay}"/>
<Rectangle Margin="5 0" Width="12" Height="12" Fill="{Binding Result, Converter={StaticResource ResultConverter}}"/>
<TextBlock Margin="2 0" Text="{Binding Name}" VerticalAlignment="Center"/>
</StackPanel>
</TreeViewItem>
</TreeView>
But it gives me an error "Items collection must be empty before using itemssource". I have visited some articles but could not find the reason for this.
Please anyone let me know how to solve this?
Thanks,