En el código fuente de AutoCompleteBox (descargable desde Microsoft) me encontré con lo siguiente:Silverlight 4 AutoCompleteBox, el establecimiento de SelectedItem en null
/// <summary>
/// Called when the selected item is changed, updates the text value
/// that is displayed in the text box part.
/// </summary>
/// <param name="newItem">The new item.</param>
private void OnSelectedItemChanged(object newItem)
{
string text;
if (newItem == null)
{
text = SearchText;
}
else
{
text = FormatValue(newItem, true);
}
// Update the Text property and the TextBox values
UpdateTextValue(text);
// Move the caret to the end of the text box
if (TextBox != null && Text != null)
{
TextBox.SelectionStart = Text.Length;
}
}
Lo que me preocupa es {text = SearchText;} línea. Si enlace SelectedItem a mi ViewModel y después de una entrada de búsqueda en AutoCompleteBox, SearchText no está vacío, cuando los datos subyacentes se restablecen a null, AutoCompleteBox puede mostrar SearchText en lugar de cadena vacía. ¿Alguien puede explicar por qué está escrito de esta manera y sugerir una solución alternativa?
Gracias por apuntarme en la dirección correcta. –