But if i am typing more than 1 letter or number in the Font Familiy Box or Size Box , the dialog remains open and overwrites the selected text which i'm trying to change the font properties of.
Are there any properties to avoid this ?! or is this a real bug??
Comments: ** Comment from web user: fecub **
So i have now added the if (IsDropDownOpen) clause to the selectionchanged event of both comboboxes (FontFamily and FontSize) and added a KeyUp event to both Comboboxes which look like this:
```
private void FontFamily_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Enter && _cmbFontFamilies.SelectedValue != null)
{
ApplyPropertyValueToSelectedText(TextElement.FontFamilyProperty, _cmbFontFamilies.SelectedValue);
}
}
private void FontSize_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{
if ((e.Key == System.Windows.Input.Key.Enter) && (!string.IsNullOrEmpty(_cmbFontSizes.Text)) )
{
ApplyPropertyValueToSelectedText(TextElement.FontSizeProperty, _cmbFontSizes.Text);
}
}
```
I did not need to register a new keyup event in the OnApplyTemplate Method,
both comboboxes work fine now, thank you for your help.