Gets or sets a value that indicates whether the element can receive focus. This is a .GTMT
Assembly: PresentationCore (in PresentationCore.dll)
Only the focused element receives keyboard input.
A style or template is applied to an element, which sets that value differently.GTMT
For example, the apparent "default" of Button control will be true, even though Button inherits as a common language runtime (CLR) property directly from UIElement. This is because the applied metadata value for the was overridden within the static constructor of the Control base class, which is situated between Button and UIElement in the class hierarchy.GTMTfor a
Notes to Inheritors:
When deriving from UIElement directly (as opposed to from Control), consider whether you wish your element to be focusable, because by default the element will not be focusable. If you wish your element to be focusable, override the metadata for this property within your type's static constructor as follows:Code snippet is not found. Confirm that the code snippet name 'CorePseudocode' is correct.
where myElement should be the class name of the type that you are overriding the metadata value on.
Legacy Code Example
The following example code illustrates a control template for a particular custom control, which setsfalse on one of the elements within the template.Code snippet is not found. Confirm that the code snippet name 'RichTextBox_NoScrollViewer' is correct.
Available since 3.0