Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on a WPF application.
In one of the XAML, we have a Custom UserControl followed by a listview.
I have added a ContextMenu for Listview items. Each context menu item has access key (i.e. for Remove... it is _Remove so that it will appear as Remove Here R is an access key )
When i click on any item in the Listview and then press right click button on the keyboard, Context menu appears and i can navigate through it with the help of arrow keys.

But when i tried to do this using Access keys, nothing happens . I use same XAML for multiple type of data. Wherever the first CustomUserControl is absent (i.e. disabled and hided ) Acess keys work fine.

I tried with making
C#
Focusable=false
for the custom user control. In this case it works for some more screens but not for all.

What i analyzed is it is an issue with the focus. Is there any simple solution to it.
Posted

1 solution

So why don't you add a fake CustomUserControl in front of all others and disable and hide that one? It's a nasty solution, but noone here seems to know a better one :-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900