I'm working on an adorner that lets the user specify some text for a property value. This requires setting the adorner panel's
IsContentFocusable property to true. I've noticed that if you press the delete key while the text box has focus, the designer handles the delete key and deletes the control. This is most definitely not what I want.
Jim Nakashima acknowledged the bug in
this blog post(I don't see anything about it on Connect), but offered no workaround other than a vague hint that a task
may be able to fix it.
I tried writing a taskthat I set onthe adorner to specifically handle the delete key, but the task is not executed. I tried passing an editing context to the adorner, getting the DesignerView from that context, and handling the PreviewKeyDown event, but this does not work. I tried handling PreviewKeyDown on thetext box itself, but this did not work. I am certain there is a way to accomplish this as I've seen some third-party controls that use a text box as part of a design-time adorner (in particular the ones mentioned in the blog comments.)
Any suggestions for how to tackle this that I haven't considered?