C# Class Microsoft.Unsupported.TiltEffect

Provides attached properties for adding a 'tilt' effect to all controls within a container
Inheritance: System.Windows.DependencyObject
Exibir arquivo Open project: salfab/open-syno Class Usage Examples

Public Properties

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

Public Methods

Method Description
GetIsTiltEnabled ( DependencyObject source ) : bool

Gets the IsTiltEnabled dependency property from an object

GetSuppressTilt ( DependencyObject source ) : bool

Gets the SuppressTilt dependency property from an object

SetIsTiltEnabled ( DependencyObject source, bool value ) : void

Sets the IsTiltEnabled dependency property on an object

SetSuppressTilt ( DependencyObject source, bool value ) : void

Sets the SuppressTilt dependency property from an object

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

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 (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, etc.)

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 pretty 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 pretty basic; it doesn't do anything to detect if the control being un-prepared was previously prepared

StopTiltReturnStoryboardAndCleanup ( ) : void

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

TiltEffect ( ) : Microsoft.Phone.Controls

Initialize the static properties

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

Method Details

GetIsTiltEnabled() public static method

Gets the IsTiltEnabled dependency property from an object
public static GetIsTiltEnabled ( DependencyObject source ) : bool
source System.Windows.DependencyObject The object to get the property from
return bool

GetSuppressTilt() public static method

Gets the SuppressTilt dependency property from an object
public static GetSuppressTilt ( DependencyObject source ) : bool
source System.Windows.DependencyObject The object to get the property from
return bool

SetIsTiltEnabled() public static method

Sets the IsTiltEnabled dependency property on an object
public static SetIsTiltEnabled ( DependencyObject source, bool value ) : void
source System.Windows.DependencyObject The object to set the property on
value bool The value to set
return void

SetSuppressTilt() public static method

Sets the SuppressTilt dependency property from an object
public static SetSuppressTilt ( DependencyObject source, bool value ) : void
source System.Windows.DependencyObject The object to get the property from
value bool
return void

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