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
- ProvidersHelper.cs
- StringWriter.cs
- WindowsAuthenticationModule.cs
- AnnotationObservableCollection.cs
- RotationValidation.cs
- TextServicesCompartment.cs
- ChineseLunisolarCalendar.cs
- precedingsibling.cs
- DateTimeParse.cs
- Command.cs
- EntityProviderFactory.cs
- XmlArrayAttribute.cs
- CodeSubDirectory.cs
- DictionaryEntry.cs
- OdbcConnectionPoolProviderInfo.cs
- ResXBuildProvider.cs
- RepeatBehavior.cs
- TabControlToolboxItem.cs
- ErrorEventArgs.cs
- FileDialog_Vista_Interop.cs
- ISAPIWorkerRequest.cs
- ToolStripContentPanelRenderEventArgs.cs
- DateBoldEvent.cs
- ManipulationVelocities.cs
- PolicyLevel.cs
- QueryStack.cs
- Or.cs
- DispatcherBuilder.cs
- StylusPointPropertyInfo.cs
- CompilerScope.cs
- C14NUtil.cs
- ColumnMapProcessor.cs
- RelationshipEndCollection.cs
- Condition.cs
- httpapplicationstate.cs
- TrustManager.cs
- ToolStripComboBox.cs
- BaseInfoTable.cs
- PersonalizationDictionary.cs
- DataGridViewTextBoxCell.cs
- DataListItemEventArgs.cs
- PermissionAttributes.cs
- CollectionViewSource.cs
- WebBrowserContainer.cs
- ProtectedConfiguration.cs
- AsymmetricSignatureFormatter.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- InheritanceAttribute.cs
- IconHelper.cs
- DrawingBrush.cs
- dtdvalidator.cs
- ApplicationProxyInternal.cs
- BuildProviderCollection.cs
- ComponentEditorPage.cs
- AbandonedMutexException.cs
- TextCompositionManager.cs
- XsltSettings.cs
- Span.cs
- ReferencedType.cs
- BrushConverter.cs
- ComplexPropertyEntry.cs
- TableRowCollection.cs
- Viewport3DVisual.cs
- AdornerLayer.cs
- HandlerBase.cs
- SuppressMergeCheckAttribute.cs
- BitmapMetadataBlob.cs
- RadioButtonFlatAdapter.cs
- reliableinputsessionchannel.cs
- OutputScopeManager.cs
- UInt64Storage.cs
- DataConnectionHelper.cs
- WinFormsComponentEditor.cs
- PagedDataSource.cs
- DataReaderContainer.cs
- DataGridViewUtilities.cs
- BlockingCollection.cs
- ResourcePart.cs
- KeyConverter.cs
- CollectionType.cs
- XsltConvert.cs
- IntegerFacetDescriptionElement.cs
- DataFieldConverter.cs
- TemplatedWizardStep.cs
- SmiConnection.cs
- RepeaterCommandEventArgs.cs
- Highlights.cs
- Highlights.cs
- SmtpLoginAuthenticationModule.cs
- DefaultExpressionVisitor.cs
- CheckBoxField.cs
- StaticSiteMapProvider.cs
- InvalidFilterCriteriaException.cs
- AutomationPeer.cs
- TraceHandlerErrorFormatter.cs
- ConsumerConnectionPointCollection.cs
- Stack.cs
- ReadWriteSpinLock.cs
- BaseProcessor.cs
- FontDriver.cs