C# Class WinRTXamlToolkit.Controls.InteractionHelper

The InteractionHelper provides controls with support for all of the common interactions like mouse movement, mouse clicks, key presses, etc., and also incorporates proper event semantics when the control is disabled.
Show file Open project: xyzzer/WinRTXamlToolkit Class Usage Examples

Private Properties

Property Type Description
GetLogicalKey VirtualKey
OnIsEnabledChanged void
OnIsReadOnlyChanged void
OnLoaded void
UpdateVisualState void

Public Methods

Method Description
AllowGotFocus ( RoutedEventArgs e ) : bool

Check if the control's GotFocus event should be handled.

AllowKeyDown ( KeyRoutedEventArgs e ) : bool

Check if the control's KeyDown event should be handled.

AllowKeyUp ( KeyRoutedEventArgs e ) : bool

Check if the control's KeyUp event should be handled.

AllowLostFocus ( RoutedEventArgs e ) : bool

Check if the control's LostFocus event should be handled.

AllowMouseEnter ( PointerRoutedEventArgs e ) : bool

Check if the control's MouseEnter event should be handled.

AllowMouseLeave ( PointerRoutedEventArgs e ) : bool

Check if the control's MouseLeave event should be handled.

AllowMouseLeftButtonDown ( PointerRoutedEventArgs e ) : bool

Check if the control's MouseLeftButtonDown event should be handled.

AllowMouseLeftButtonUp ( PointerRoutedEventArgs e ) : bool

Check if the control's MouseLeftButtonUp event should be handled.

InteractionHelper ( Control control ) : System

Initializes a new instance of the InteractionHelper class.

OnApplyTemplateBase ( ) : void

Update the visual state of the control when its template is changed.

OnGotFocusBase ( ) : void

Base implementation of the virtual GotFocus event handler.

OnLostFocusBase ( ) : void

Base implementation of the virtual LostFocus event handler.

OnMouseEnterBase ( ) : void

Base implementation of the virtual MouseEnter event handler.

OnMouseLeaveBase ( ) : void

Base implementation of the virtual MouseLeave event handler.

OnMouseLeftButtonDownBase ( ) : void

Base implementation of the virtual MouseLeftButtonDown event handler.

OnMouseLeftButtonUpBase ( ) : void

Base implementation of the virtual MouseLeftButtonUp event handler.

UpdateVisualStateBase ( bool useTransitions ) : void

Update the visual state of the control.

Private Methods

Method Description
GetLogicalKey ( FlowDirection flowDirection, VirtualKey originalKey ) : VirtualKey
OnIsEnabledChanged ( object sender, DependencyPropertyChangedEventArgs e ) : void

Handle changes to the control's IsEnabled property.

OnIsReadOnlyChanged ( bool value ) : void
OnLoaded ( object sender, RoutedEventArgs e ) : void

Handle the control's Loaded event.

UpdateVisualState ( bool useTransitions ) : void

Update the visual state of the control.

UpdateVisualState works differently than the rest of the injected functionality. Most of the other events are overridden by the calling class which calls Allow, does what it wants, and then calls Base. UpdateVisualState is the opposite because a number of the methods in InteractionHelper need to trigger it in the calling class. We do this using the IUpdateVisualState internal interface.

Method Details

AllowGotFocus() public method

Check if the control's GotFocus event should be handled.
public AllowGotFocus ( RoutedEventArgs e ) : bool
e Windows.UI.Xaml.RoutedEventArgs Event arguments.
return bool

AllowKeyDown() public method

Check if the control's KeyDown event should be handled.
public AllowKeyDown ( KeyRoutedEventArgs e ) : bool
e Windows.UI.Xaml.Input.KeyRoutedEventArgs Event arguments.
return bool

AllowKeyUp() public method

Check if the control's KeyUp event should be handled.
public AllowKeyUp ( KeyRoutedEventArgs e ) : bool
e Windows.UI.Xaml.Input.KeyRoutedEventArgs Event arguments.
return bool

AllowLostFocus() public method

Check if the control's LostFocus event should be handled.
public AllowLostFocus ( RoutedEventArgs e ) : bool
e Windows.UI.Xaml.RoutedEventArgs Event arguments.
return bool

AllowMouseEnter() public method

Check if the control's MouseEnter event should be handled.
public AllowMouseEnter ( PointerRoutedEventArgs e ) : bool
e Windows.UI.Xaml.Input.PointerRoutedEventArgs Event arguments.
return bool

AllowMouseLeave() public method

Check if the control's MouseLeave event should be handled.
public AllowMouseLeave ( PointerRoutedEventArgs e ) : bool
e Windows.UI.Xaml.Input.PointerRoutedEventArgs Event arguments.
return bool

AllowMouseLeftButtonDown() public method

Check if the control's MouseLeftButtonDown event should be handled.
public AllowMouseLeftButtonDown ( PointerRoutedEventArgs e ) : bool
e Windows.UI.Xaml.Input.PointerRoutedEventArgs Event arguments.
return bool

AllowMouseLeftButtonUp() public method

Check if the control's MouseLeftButtonUp event should be handled.
public AllowMouseLeftButtonUp ( PointerRoutedEventArgs e ) : bool
e Windows.UI.Xaml.Input.PointerRoutedEventArgs Event arguments.
return bool

InteractionHelper() public method

Initializes a new instance of the InteractionHelper class.
public InteractionHelper ( Control control ) : System
control Windows.UI.Xaml.Controls.Control Control receiving interaction.
return System

OnApplyTemplateBase() public method

Update the visual state of the control when its template is changed.
public OnApplyTemplateBase ( ) : void
return void

OnGotFocusBase() public method

Base implementation of the virtual GotFocus event handler.
public OnGotFocusBase ( ) : void
return void

OnLostFocusBase() public method

Base implementation of the virtual LostFocus event handler.
public OnLostFocusBase ( ) : void
return void

OnMouseEnterBase() public method

Base implementation of the virtual MouseEnter event handler.
public OnMouseEnterBase ( ) : void
return void

OnMouseLeaveBase() public method

Base implementation of the virtual MouseLeave event handler.
public OnMouseLeaveBase ( ) : void
return void

OnMouseLeftButtonDownBase() public method

Base implementation of the virtual MouseLeftButtonDown event handler.
public OnMouseLeftButtonDownBase ( ) : void
return void

OnMouseLeftButtonUpBase() public method

Base implementation of the virtual MouseLeftButtonUp event handler.
public OnMouseLeftButtonUpBase ( ) : void
return void

UpdateVisualStateBase() public method

Update the visual state of the control.
public UpdateVisualStateBase ( bool useTransitions ) : void
useTransitions bool /// A value indicating whether to automatically generate transitions to /// the new state, or instantly transition to the new state. ///
return void