C# 自动完成windows phone C的字典#

C# 自动完成windows phone C的字典#,c#,windows-phone-7,dictionary,C#,Windows Phone 7,Dictionary,我有一本字典: Dictionary d=newdictionary() 我把它们放在一个自动完成框中: autobox.ItemsSource=d 仅显示该键的当前位置 <toolkit:AutoCompleteBox x:Name="autobox" ValueMemberPath="Key" > <toolkit:AutoCompleteBox.ItemTemplate> <DataTemplate>

我有一本字典:

Dictionary d=newdictionary()

我把它们放在一个
自动完成框中

autobox.ItemsSource=d

仅显示该键的当前位置

<toolkit:AutoCompleteBox x:Name="autobox" ValueMemberPath="Key" >
     <toolkit:AutoCompleteBox.ItemTemplate>
          <DataTemplate>
               <TextBlock Text="{Binding Key}" Tap="Item_Tap" />
           </DataTemplate>
     </toolkit:AutoCompleteBox.ItemTemplate>
</toolkit:AutoCompleteBox>
但是当我点击一个结果时,什么也不会出现。我哪里出错了


感谢您的帮助

尝试创建自己的元素模型并绑定到此元素列表。在这个模型中,创建方法OnTap或类似的东西,并用EventToCommand将Tap绑定到这个方法。

你的事件项\u Tap甚至命中了吗?它适用于我的列表框,但我想Item Tap不适用于自动完成框。TextBlock\u MouseEnter i这是我问题的适当事件之一。我已经让它工作了。谢谢你的回复
private void Item_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
     var s = sender as TextBlock;
     Messagebox.Show(d[s.Text]);            
}