FocusBehavior ClassDW.WPFToolkit Documentation
Brings the feature to set the focus to a specific element or on window launch.
Inheritance Hierarchy

SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      DW.WPFToolkit.InteractivityFocusBehavior

Namespace: DW.WPFToolkit.Interactivity
Assembly: DW.WPFToolkit (in DW.WPFToolkit.dll) Version: 5.6.0.0
Syntax

C#
public class FocusBehavior : DependencyObject

The FocusBehavior type exposes the following members.

Constructors

  NameDescription
Public methodFocusBehavior
Initializes a new instance of the FocusBehavior class
Top
Methods

  NameDescription
Public methodStatic memberGetApplicationGotFocusCommand
Gets the command to be executed when the application become the foreground application.
Public methodStatic memberGetApplicationGotFocusCommandParameter
Gets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.ApplicationGotFocusCommand.
Public methodStatic memberGetApplicationLostFocusCommand
Gets the command to be executed when the application is not the foreground application anymore.
Public methodStatic memberGetApplicationLostFocusCommandParameter
Gets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.ApplicationLostFocusCommand.
Public methodStatic memberGetGotFocusCommand
Gets the command to be executed when the element got the focus.
Public methodStatic memberGetGotFocusCommandParameter
Gets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.GotFocusCommand.
Public methodStatic memberGetHasFocus
Gets a value that indicates the state if the element has the focus or not.
Public methodStatic memberGetLostFocusCommand
Gets the command to be executed when the element lost its focus.
Public methodStatic memberGetLostFocusCommandParameter
Gets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.LostFocusCommand.
Public methodStatic memberGetStartFocusedControl
Gets the control which has to get the focus when its loaded.
Public methodStatic memberSetApplicationGotFocusCommand
Attaches the command to be executed when the application become the foreground application.
Public methodStatic memberSetApplicationGotFocusCommandParameter
Sets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.ApplicationGotFocusCommand.
Public methodStatic memberSetApplicationLostFocusCommand
Attaches the command to be executed when the application is not the foreground application anymore.
Public methodStatic memberSetApplicationLostFocusCommandParameter
Sets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.ApplicationLostFocusCommand.
Public methodStatic memberSetGotFocusCommand
Attaches the command to be executed when the control got the focus.
Public methodStatic memberSetGotFocusCommandParameter
Sets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.GotFocusCommand.
Public methodStatic memberSetHasFocus
Attaches a value that indicates the state if the element has the focus or not.
Public methodStatic memberSetLostFocusCommand
Attaches the command to be executed when the control lost its focus.
Public methodStatic memberSetLostFocusCommandParameter
Sets the parameter to be passed with the DW.WPFToolkit.Interactivity.FocusBehavior.LostFocusCommand.
Public methodStatic memberSetStartFocusedControl
Attaches the control which has to get the focus when its loaded.
Top
Fields

  NameDescription
Public fieldStatic memberApplicationGotFocusCommandParameterProperty
Public fieldStatic memberApplicationGotFocusCommandProperty
Public fieldStatic memberApplicationLostFocusCommandParameterProperty
Public fieldStatic memberApplicationLostFocusCommandProperty
Public fieldStatic memberGotFocusCommandParameterProperty
Public fieldStatic memberGotFocusCommandProperty
Public fieldStatic memberHasFocusProperty
Public fieldStatic memberLostFocusCommandParameterProperty
Public fieldStatic memberLostFocusCommandProperty
Public fieldStatic memberStartFocusedControlProperty
Top
Attached Properties

  NameDescription
Public attached propertyApplicationGotFocusCommand
Public attached propertyApplicationGotFocusCommandParameter
Public attached propertyApplicationLostFocusCommand
Public attached propertyApplicationLostFocusCommandParameter
Public attached propertyGotFocusCommand
Public attached propertyGotFocusCommandParameter
Public attached propertyHasFocus
Public attached propertyLostFocusCommand
Public attached propertyLostFocusCommandParameter
Public attached propertyStartFocusedControl
Top
Examples

XAML
<Window Interactivity:FocusBehavior.ApplicationGotFocusCommand="{Binding SwitchedToApplicationCommand}"
        Interactivity:FocusBehavior.ApplicationLostFocusCommand="{Binding SwitchedOutFromApplicationCommand}">
</Window>

<Button Interactivity:FocusBehavior.GotFocusCommand="{Binding ButtonGotFocusCommand}"
        Interactivity:FocusBehavior.GotFocusCommandParameter="Example" />

<Button Interactivity:FocusBehavior.LostFocusCommand="{Binding ButtonGotFocusCommand}"
        Interactivity:FocusBehavior.LostFocusCommandParameter="Example" />

<Button Interactivity:FocusBehavior.HasFocus="{Binding IsButtonFocused}" />
See Also

Reference