【发布时间】:2011-08-22 19:18:43
【问题描述】:
我正在尝试为 Windows Phone 7 应用程序的搜索建议/历史创建自定义弹出窗口,但我遇到了一些我无法解决的问题。
我在弹出窗口中使用 ListBox 来显示我的结果,但是,
a) 我的项目没有正确显示,它列出了从 -1 位置开始的项目???在 ListBox 中,但当被选中时,它们会给出下面的值。
b) 在我的页面中,我有一个显示搜索结果的列表框,并且我的弹出建议显示在此列表框上(在文本框下方),当我滚动/选择建议时,下方的列表框会滚动并选择项目。
请问有人知道解决方法或解决方法吗?
这是我的(简化的)代码:
<Popup Name="AutoCompleteList">
<Border Background="White" BorderThickness="1" BorderBrush="Black" HorizontalAlignment="Center">
<ListBox x:Name="ListItems" HorizontalAlignment="Left" Height="Auto">
<ListBoxItem>
<TextBlock Text="Test1" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test2" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test3" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test4" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test5" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test6" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test7" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test8" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test9" Foreground="Black" />
</ListBoxItem>
<ListBoxItem>
<TextBlock Text="Test10" Foreground="Black" />
</ListBoxItem>
</ListBox>
</Border>
</Popup>
谢谢。
【问题讨论】:
标签: silverlight windows-phone-7