AutoCompleteBox के स्रोत कोड में की स्थापना (Microsoft से डाउनलोड किया जा सकता) मैं निम्नलिखित पाया:सिल्वरलाइट 4 AutoCompleteBox, SelectedItem शून्य पर
/// <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;
}
}
मुझे क्या परेशानी पैदा करती है {पाठ = SearchText;} है लाइन। अगर मैं अपने व्यूमोडेल में चयनित इटैम को बांधता हूं और ऑटोकंपलेटबॉक्स में एक खोज प्रविष्टि के बाद, सर्चटेक्स्ट खाली नहीं होता है, तो जब अंतर्निहित डेटा शून्य पर रीसेट हो जाता है, तो ऑटोकंपलेटबॉक्स खाली स्ट्रिंग के बजाय सर्चटेक्स्ट प्रदर्शित कर सकता है। क्या कोई यह समझा सकता है कि यह इस तरह क्यों लिखा गया है, और एक समाधान का सुझाव है?
सही दिशा में मुझे इंगित करने के लिए धन्यवाद। –