Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4155
How to bind Command to this subitem in XamDataTree?
posted

I have a XamDataTree, which i need to bind a command to.  I am using MVVM.  In the ViewModel is the ShowReportCommand.  How do i set this up so it works, without the binding error i currently have:

<igDT:XamDataTree Name="Reports" ItemsSource="{Binding ReportList}" NodeLineVisibility="Visible" 
                                                  Height="Auto" MaxHeight="300" BorderThickness="0"
                                                  Width="Auto" MaxWidth="{Binding ElementName=ReportsExpander, Path=ActualWidth, Converter={StaticResource WidthMinusScrollConverter}}" >
                                    <igDT:XamDataTree.GlobalNodeLayouts>
                                        <igDT:NodeLayout Key="ReportFolder" TargetTypeName="ReportFolder" DisplayMemberPath="FolderName" />
                                        <igDT:NodeLayout Key="Report" TargetTypeName="Report" DisplayMemberPath="DisplayName">
                                            <igDT:NodeLayout.ItemTemplate>
                                                <DataTemplate>
                                                    <Button Style="{StaticResource LinkButton}" 
                                                            Command="{Binding ShowReportCommand}"
                                                            CommandParameter="{Binding}" >
                                                        <StackPanel Orientation="Horizontal" >
                                                            <Image Source="/Resources/Icons/report.png"/>
                                                            <TextBlock Text="{Binding Data.DisplayName}" Style="{StaticResource MenuTB}" />
                                                        </StackPanel>
                                                    </Button>
                                                </DataTemplate>
                                            </igDT:NodeLayout.ItemTemplate>
                                        </igDT:NodeLayout>
                                    </igDT:XamDataTree.GlobalNodeLayouts>
                                </igDT:XamDataTree>