Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Animation / ElasticEase.cs / 1305600 / ElasticEase.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation, 2008 // // File: ElasticEase.cs //----------------------------------------------------------------------------- using MS.Internal; namespace System.Windows.Media.Animation { ////// This class implements an easing function that gives an elastic/springy curve /// public class ElasticEase : EasingFunctionBase { public ElasticEase() { } ////// Bounces Property /// public static readonly DependencyProperty OscillationsProperty = DependencyProperty.Register( "Oscillations", typeof(int), typeof(ElasticEase), new PropertyMetadata(3)); ////// Specifies the number of oscillations /// public int Oscillations { get { return (int)GetValue(OscillationsProperty); } set { SetValueInternal(OscillationsProperty, value); } } ////// Springiness Property /// public static readonly DependencyProperty SpringinessProperty = DependencyProperty.Register( "Springiness", typeof(double), typeof(ElasticEase), new PropertyMetadata(3.0)); ////// Specifies the amount of springiness /// public double Springiness { get { return (double)GetValue(SpringinessProperty); } set { SetValueInternal(SpringinessProperty, value); } } protected override double EaseInCore(double normalizedTime) { double oscillations = Math.Max(0.0, (double)Oscillations); double springiness = Math.Max(0.0, Springiness); double expo; if (DoubleUtil.IsZero(springiness)) { expo = normalizedTime; } else { expo = (Math.Exp(springiness * normalizedTime) - 1.0) / (Math.Exp(springiness) - 1.0); } return expo * (Math.Sin((Math.PI * 2.0 * oscillations + Math.PI * 0.5) * normalizedTime)); } protected override Freezable CreateInstanceCore() { return new ElasticEase(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NativeCppClassAttribute.cs
- FontFamilyConverter.cs
- StringCollection.cs
- WhiteSpaceTrimStringConverter.cs
- IncrementalReadDecoders.cs
- ExpandoObject.cs
- IdentityManager.cs
- UpdateProgress.cs
- ManagedIStream.cs
- UnmanagedMemoryStreamWrapper.cs
- Classification.cs
- RequestContext.cs
- ObjectParameterCollection.cs
- SQLInt16Storage.cs
- MessageSmuggler.cs
- BrowserTree.cs
- CqlLexerHelpers.cs
- DataGridViewLinkCell.cs
- LineInfo.cs
- DummyDataSource.cs
- BuilderPropertyEntry.cs
- AVElementHelper.cs
- OdbcRowUpdatingEvent.cs
- CreatingCookieEventArgs.cs
- SecurityUtils.cs
- PeerCollaborationPermission.cs
- Soap.cs
- AssemblyContextControlItem.cs
- AddValidationError.cs
- SubMenuStyleCollection.cs
- DataErrorValidationRule.cs
- SortKey.cs
- WindowsFormsHost.cs
- DecimalAnimationBase.cs
- BuildProviderAppliesToAttribute.cs
- DynamicRendererThreadManager.cs
- ColorTranslator.cs
- _FtpDataStream.cs
- RsaKeyGen.cs
- ValueExpressions.cs
- WeakEventTable.cs
- SizeAnimationUsingKeyFrames.cs
- HttpListenerContext.cs
- ResXResourceSet.cs
- TypeUnloadedException.cs
- TextSelection.cs
- ELinqQueryState.cs
- VectorCollectionValueSerializer.cs
- DataMember.cs
- CompressionTransform.cs
- PriorityRange.cs
- RootBrowserWindowProxy.cs
- CharAnimationUsingKeyFrames.cs
- DbProviderFactories.cs
- ToolTipAutomationPeer.cs
- GradientBrush.cs
- DbCommandTree.cs
- DesigntimeLicenseContext.cs
- EntityDataSourceContainerNameItem.cs
- PerformanceCounterPermissionEntryCollection.cs
- DSACryptoServiceProvider.cs
- UpdateTracker.cs
- _ScatterGatherBuffers.cs
- COAUTHIDENTITY.cs
- ISSmlParser.cs
- XPathNavigatorReader.cs
- Int32Converter.cs
- XmlEncoding.cs
- ApplicationContext.cs
- SqlTriggerContext.cs
- KeyNotFoundException.cs
- DataTrigger.cs
- XmlFormatExtensionAttribute.cs
- SqlMethodCallConverter.cs
- Int32CollectionValueSerializer.cs
- DeflateInput.cs
- SmiMetaDataProperty.cs
- DragStartedEventArgs.cs
- RunInstallerAttribute.cs
- StateDesigner.TransitionInfo.cs
- ELinqQueryState.cs
- LockedBorderGlyph.cs
- DataBoundControlHelper.cs
- Compensation.cs
- StorageEntitySetMapping.cs
- IndexObject.cs
- CacheChildrenQuery.cs
- SqlDataSourceTableQuery.cs
- BaseResourcesBuildProvider.cs
- DataGridCell.cs
- __TransparentProxy.cs
- LinqDataView.cs
- ImageIndexConverter.cs
- ReceiveParametersContent.cs
- AttachedPropertyBrowsableAttribute.cs
- FunctionParameter.cs
- DesignerGenericWebPart.cs
- DecimalSumAggregationOperator.cs
- KeyConstraint.cs
- BufferBuilder.cs