private void OnSelectedItemChanged(object newItem)
{
var text = newItem == null ? SearchText : 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;
}
}