private void SearchTextBox_GotKeyboardForcus(object sender, KeyboardFocusChangedEventArgs e) { // If the library search box is empty, the watermark text will be visible. We'll make sure that narrator reads it. if (string.IsNullOrEmpty(SearchTextBox.Text)) { var removeCharacterExtension = new RemoveCharacterExtension(ViewModel.WatermarkText, "<>"); string watermarkText = (string)removeCharacterExtension.ProvideValue(ServiceProvider.GlobalProvider); SearchTextBox.SetValue(AutomationProperties.HelpTextProperty, watermarkText); } else { SearchTextBox.ClearValue(AutomationProperties.HelpTextProperty); } e.Handled = true; }
private void LibrarySearchBox_GotKeyboardForcus(object sender, KeyboardFocusChangedEventArgs e) { // If the library search box is empty, the watermark text will be visible. We'll make sure that narrator reads it. if (string.IsNullOrEmpty(LibrarySearchBox.Text)) { RemoveCharacterExtension removeCharacterExtension = new RemoveCharacterExtension(Microsoft.Web.LibraryManager.Vsix.Resources.Text.TypeToSearch, "<>"); string watermarkText = (string)removeCharacterExtension.ProvideValue(ServiceProvider.GlobalProvider); LibrarySearchBox.SetValue(AutomationProperties.HelpTextProperty, watermarkText); } else { LibrarySearchBox.ClearValue(AutomationProperties.HelpTextProperty); } e.Handled = true; }