C# Class Microsoft.Phone.Controls.TiltEffect

This code provides attached properties for adding a 'tilt' effect to all controls within a container.
显示文件 Open project: Kinnara/WPToolkit Class Usage Examples

Public Properties

Property Type Description
IsTiltEnabledProperty System.Windows.DependencyProperty
SuppressTiltProperty System.Windows.DependencyProperty

Private Properties

Property Type Description
ApplyTiltEffect void
BeginTiltEffect void
ContinueTiltEffect void
EndTiltEffect void
GetCenterToCenterDelta System.Windows.Point
GetIsTiltEnabled bool
GetSuppressTilt bool
OnIsTiltEnabledChanged void
PauseTiltEffect void
PrepareControlForTilt bool
PrepareTiltReturnStoryboard void
ResetTiltEffect void
ResetTiltReturnStoryboard void
RevertPrepareControlForTilt void
SetIsTiltEnabled void
SetSuppressTilt void
StartTiltEffectOnLLS void
StopTiltReturnStoryboardAndCleanup void
TiltEffect System
TiltEffect_ManipulationCompleted void
TiltEffect_ManipulationDelta void
TiltEffect_ManipulationStarted void
TiltReturnStoryboard_Completed void
TryStartTiltEffect void

Private Methods

Method Description
ApplyTiltEffect ( FrameworkElement element, Point touchPoint, Point centerPoint ) : void

Applies the tilt effect to the control.

BeginTiltEffect ( FrameworkElement element, Point touchPoint, Point centerPoint, Point centerDelta ) : void

Begins the tilt effect by preparing the control and doing the initial animation.

ContinueTiltEffect ( FrameworkElement element, System.Windows.Input.ManipulationDeltaEventArgs e ) : void

Continues a tilt effect that is currently applied to an element, presumably because the user moved their finger.

EndTiltEffect ( FrameworkElement element ) : void

Ends the tilt effect by playing the animation.

GetCenterToCenterDelta ( FrameworkElement element, FrameworkElement container ) : Point

Computes the delta between the centre of an element and its container.

GetIsTiltEnabled ( DependencyObject source ) : bool
GetSuppressTilt ( DependencyObject source ) : bool
OnIsTiltEnabledChanged ( DependencyObject target, System.Windows.DependencyPropertyChangedEventArgs args ) : void

Property change handler for the IsTiltEnabled dependency property.

Adds or removes event handlers from the element that has been (un)registered for tilting.

PauseTiltEffect ( ) : void

Pauses the tilt effect so that the control returns to the 'at rest' position, but doesn't stop the tilt effect (handlers are still attached).

PrepareControlForTilt ( FrameworkElement element, Point centerDelta ) : bool

Prepares a control to be tilted by setting up a plane projection and some event handlers.

This method is conservative; it will fail any attempt to tilt a control that already has a projection on it.

PrepareTiltReturnStoryboard ( FrameworkElement element ) : void

Creates the tilt return storyboard (if not already created) and targets it to the projection.

ResetTiltEffect ( FrameworkElement element ) : void

Resets the tilt effect on the control, making it appear 'normal' again.

This method doesn't turn off the tilt effect or cancel any current manipulation; it just temporarily cancels the effect.

ResetTiltReturnStoryboard ( ) : void

Resets the storyboard to not running.

RevertPrepareControlForTilt ( FrameworkElement element ) : void

Removes modifications made by PrepareControlForTilt.

This method is basic; it does not do anything to detect if the control being un-prepared was previously prepared.

SetIsTiltEnabled ( DependencyObject source, bool value ) : void
SetSuppressTilt ( DependencyObject source, bool value ) : void
StartTiltEffectOnLLS ( LongListSelector lls, System.Windows.Input.ManipulationStartedEventArgs e ) : void

Starts the tilt effect on LLS items or sticky header.

StopTiltReturnStoryboardAndCleanup ( ) : void

Stops the tilt effect and release resources applied to the currently tilted control.

TiltEffect ( ) : System

This is not a constructable class, but it cannot be static because it derives from DependencyObject.

TiltEffect_ManipulationCompleted ( object sender, System.Windows.Input.ManipulationCompletedEventArgs e ) : void

Event handler for ManipulationCompleted.

TiltEffect_ManipulationDelta ( object sender, System.Windows.Input.ManipulationDeltaEventArgs e ) : void

Event handler for ManipulationDelta

TiltEffect_ManipulationStarted ( object sender, System.Windows.Input.ManipulationStartedEventArgs e ) : void

Event handler for ManipulationStarted.

TiltReturnStoryboard_Completed ( object sender, EventArgs e ) : void

Handler for the storyboard complete event.

TryStartTiltEffect ( FrameworkElement source, System.Windows.Input.ManipulationStartedEventArgs e ) : void

Checks if the manipulation should cause a tilt, and if so starts the tilt effect.

Property Details

IsTiltEnabledProperty public_oe static_oe property

Whether the tilt effect is enabled on a container (and all its children).
public static DependencyProperty,System.Windows IsTiltEnabledProperty
return System.Windows.DependencyProperty

SuppressTiltProperty public_oe static_oe property

Suppresses the tilt effect on a single control that would otherwise be tilted.
public static DependencyProperty,System.Windows SuppressTiltProperty
return System.Windows.DependencyProperty