刚刚安装了几天前发布的 SL5 和工具包。
当您将 AutoCompleteBox 的 Text 属性设置为 string.Empty 时,就会发生该错误。它会导致 AutoCompleteBox 处于错误状态。要重现错误:
将 AutoCompleteBox 和 Button 添加到主页。注册到 TextChanged 和 Click 事件。这是代码隐藏:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
auto.Text = string.Empty;
}
private void auto_TextChanged(object sender, RoutedEventArgs e)
{
// Put a break point here.
}
}
在运行时:
1)在自动框中输入“aa”。
2) 点击按钮。
3) 键入“q”。(仍然调用 TextChanged)。
4) 擦除“q” -不调用 TextChanged。
5) 再次键入“q” -不调用 TextChanged。
6) 以此类推,直到您选择一个新字母。然后重新开始。