, , . AutoCompleteBox Reflector, , Enter, Escape F4 - , e.Handled = true.
, PreviewKeyDown Silverlight.
, , - OnKeyDown. - , :
public class MyAutoCompleteBox : AutoCompleteBox
{
public static readonly DependencyProperty HandleKeyEventsProperty = DependencyProperty.Register(
"HandleKeyEvents",
typeof(bool),
typeof(MyAutoCompleteBox),
new PropertyMetadata(true));
public bool HandleKeyEvents
{
get { return (bool)GetValue(HandleKeyEventsProperty); }
set { SetValue(HandleKeyEventsProperty, value); }
}
protected override void OnKeyDown(KeyEventArgs e)
{
if (this.HandleKeyEvents)
{
base.OnKeyDown(e);
}
}
}
HandleKeyEvents XAML, :
<local:MyAutoCompleteBox HandleKeyEvents="False"/>
AutoCompleteBox - e.Handled = true , - . , , KeyDown ( Enter).