Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Standard keyboard shortcuts
Message
De
06/01/2012 11:38:52
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
06/01/2012 08:32:42
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 4.0
Application:
Desktop
Divers
Thread ID:
01532175
Message ID:
01532323
Vues:
27
>>>>>>Hi everyone,
>>>>>>
>>>>>>I have a WPF application where we want to implement more shortcuts to allow the users to navigate around without the mouse. Here is a scenario.
>>>>>>
>>>>>>We have a view that contains some controls that you can tab between. Then there are some expander controls which contain either more navigatable controls or a grid. We would like to tab from control to control and down through the expanders, but I would also like to jump if you will from any control to the next expander; or expander to expander. This would allow the users to get quicker access to sections on a view.
>>>>>>
>>>>>>This application is tabbed in a main window so moving between tabs should be done with Ctrl + F-6 based on the standards I found. It appears this may be not standard within windows however as Ctrl + Tab seems to do that as well as Ctrl + Page Up / Page Dwn. Hmm, why the inconsistency?
>>>>>>
>>>>>>I would have liked to use Ctrl + PageUp/ PageDwn for the jump between sections. Now I am confused about what is standard and what would be typical to implement. Any thoughts or ideas appreciated.
>>>>>
>>>>>Maybe this will help (tho I must admit it didn't help me :-} ):
>>>>>http://msdn.microsoft.com/en-us/library/ms971323.aspx#atg_keyboardshortcuts_complying_with_standard_keyboard_navigation
>>>>
>>>>That is the same document I looked through which I eluded to. It didn't help me either since it is not consistent with the way windows is implemented. What did you use for keyboard shortcuts on navigation? What be your inclinations in the situation I gave?
>>>
>>>I confess to probably being more confused than you on this subject :-}
>>>My gut instinct would be to treat a series of expanders in the same way as nodes in a treeview. But I don't remember how it works in a treeview without trying it. Maybe it would be up/down arrows to navigate between expanders; right-arrow to expand, left-arrow to collapse ?
>>
>>I think this would be easier to implement if I could some how keep track of what element I am actually on. Using MVVM so View model could have a binding to FocusedElement * I think * but that isn't exactly a pattern correct thing to do.
>
>IIRC if you set the FocusManager.IsFocusScope on an element such as an Expander it will automatically keep track of the contained element which has focus. Maybe it won't work too well with an Expander because the ToggleButton will become the focused element when you expand but you could wrap the elements in, say, a StackPanel and set IsFocusScope on that. i.e. something like:
<Expander >
>            <StackPanel  x:Name="SP" FocusManager.IsFocusScope="True" Focusable="True" >
>                <Button >Hello</Button>
>                <TextBox Width="50" />
>                <TextBlock x:Name="TB" Height="25"></TextBlock>
>                <Button>Another</Button>
>            </StackPanel>
>        </Expander>
I did exactly that, but not sure how to keep track of this within a VM so I can set focus based on the 'jump' intention. If they are sitting on some element within expander 2 and they press a jump key sequence it needs to set focus to the first element in the expander 3. I have a MoveFocus implementation from Josh Smith in the view model that will move the focus to a bound element. Problem is, how do I know where it is so I can deteremine where to move it to.
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform