0

I am unable to pass the text of textblock tbAge as the second command parameter. Though I am able to pass the first command parameter i.e. the text of tbName. Need to understand what extra i need to add ?.

<MenuItem.ItemTemplate>
    <HierarchicalDataTemplate ItemsSource="{Binding Path=Students}">
        <TextBlock x:Name="tbAge" Text="{Binding DisplayAge}"/>
        <HierarchicalDataTemplate.ItemTemplate>
            <DataTemplate>
                <StackPanel>                                                   
                    <TextBlock x:Name="tbName" Text="{Binding}">
                        <TextBlock.InputBindings>
                            <MouseBinding Command="{Binding DataContext.NavigateToID, RelativeSource={RelativeSource AncestorType=Menu}}"  MouseAction="LeftClick" >
                                <MouseBinding.CommandParameter>
                                    <MultiBinding Converter="{StaticResource MultiCommandConverter}">
                                        <Binding Path="Text" ElementName="tbName"/>
                                        <Binding Path="Text" ElementName="tbAge" />
                                    </MultiBinding>
                                </MouseBinding.CommandParameter>
                            </MouseBinding>
                        </TextBlock.InputBindings>
                    </TextBlock>
                </StackPanel>
            </DataTemplate>
        </HierarchicalDataTemplate.ItemTemplate>
    </HierarchicalDataTemplate>
</MenuItem.ItemTemplate>
Emond
  • 50,210
  • 11
  • 84
  • 115
DotNetSpartan
  • 931
  • 4
  • 20
  • 41

0 Answers0