I’m using the Accordion control for Silverlight 4 and I recently had to add a TextBox to AccordionItem headers. Users can now enter text in the text box, but when they press the arrow keys (up or down), the enter or the whitespace keys, the accordion item collapses/expands. How can I avoid this behavior?
Share
I recently found out that, in order to avoid this behavior, I must extend both the AccordionItem and the AccordionButton classes: the former handles arrow key events, while the latter takes care of the enter and whitespace keys. Just override the OnKeyDown and OnKeyUp events as follows: