== Focus Scopes ==
Sometimes, controls need to be grouped into focus scopes so that there is always a logically focused control in that group, irrespective of the actual keyboard focus (there can only be one keyboard focused control in an application at any given time).
=== Logical Focus ===
To create a logical focus scope, make a parent control to be include ''FocusManager.IsFocusScope="True"'':
Programmatically, in C#:
StackPanel pnlsideButtonsMain= new StackPanel();
FocusManager.SetIsFocusScope(pnlsideButtonsMain, true);
To set the focus in a control (eg. a button, in this case called ''btnReports''):
// Sets the focused element in focus scope pnlsideButtonsMain
// pnlsideButtonsMain is a StackPanel.
FocusManager.SetFocusedElement(pnlsideButtonsMain, btnReports);
=== Focus Styles ===
To style a control to show keyboard focus and logical focus:
== References ==
* [[http://msdn.microsoft.com/en-us/library/aa969768.aspx|MSDN: Focus Overview]]