Visual Studio Development Bookmark and Share   
 index > Visual Studio WPF Designer > How do you create a design-time adorner that can accept the delete key?
 

How do you create a design-time adorner that can accept the delete key?

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?
opellegr  Monday, March 16, 2009 7:57 PM
Anyone thought about this? I'm starting to think that tasks are a red herring. I can't seem to make that work.
opellegr  Wednesday, March 25, 2009 3:25 PM

You can use google to search for other answers

Custom Search

More Threads

• CTP's
• not able to set itemSource Property of my custom Control
• Problem in TreeView
• WPF Designer not working with Blend 3 Behaviours
• How to apply multi Transforms to Canvas.RenderTransform?
• VS 2005 XAML IntelliSense
• Generating .chm files for WPF app
• Specified method is not supported. - Error
• listbox databinding
• Is it possible to bind to resources that live in Resources.resx for the application in XAML