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
- DocumentReferenceCollection.cs
- AbsoluteQuery.cs
- GeneralTransform3DGroup.cs
- IdentityNotMappedException.cs
- DataGridColumnHeaderAutomationPeer.cs
- COM2TypeInfoProcessor.cs
- HwndTarget.cs
- OdbcTransaction.cs
- SpeechDetectedEventArgs.cs
- SeverityFilter.cs
- CompareValidator.cs
- SqlCachedBuffer.cs
- CatalogZoneAutoFormat.cs
- HttpValueCollection.cs
- FieldMetadata.cs
- UInt32Converter.cs
- UnsafeNativeMethods.cs
- datacache.cs
- TreeNodeSelectionProcessor.cs
- AppendHelper.cs
- XmlDataSource.cs
- StackBuilderSink.cs
- ConfigurationException.cs
- Filter.cs
- ListParagraph.cs
- HtmlImage.cs
- RequestStatusBarUpdateEventArgs.cs
- SmtpReplyReader.cs
- RemotingHelper.cs
- DataGridViewColumnEventArgs.cs
- StaticTextPointer.cs
- SpellerStatusTable.cs
- HwndHost.cs
- ObjectDataSourceWizardForm.cs
- ArrayTypeMismatchException.cs
- HwndHostAutomationPeer.cs
- PropertyNames.cs
- ListViewUpdateEventArgs.cs
- EncoderBestFitFallback.cs
- translator.cs
- exports.cs
- ProxyHwnd.cs
- DateTimeFormatInfo.cs
- PersonalizationState.cs
- AbandonedMutexException.cs
- InternalTypeHelper.cs
- FileSystemEventArgs.cs
- NegotiateStream.cs
- Typography.cs
- ToolStripButton.cs
- TopClause.cs
- HttpsTransportBindingElement.cs
- DecoderNLS.cs
- Composition.cs
- PageRanges.cs
- GuidConverter.cs
- Converter.cs
- XmlComment.cs
- RuntimeEnvironment.cs
- DynamicField.cs
- TranslateTransform3D.cs
- HashAlgorithm.cs
- LocalServiceSecuritySettingsElement.cs
- SQLSingle.cs
- ExceptionHelpers.cs
- WindowsPrincipal.cs
- Parallel.cs
- DemultiplexingClientMessageFormatter.cs
- InputBuffer.cs
- DataRow.cs
- PropertyIDSet.cs
- UseAttributeSetsAction.cs
- BasicHttpMessageCredentialType.cs
- FrameworkElementFactory.cs
- HttpProxyCredentialType.cs
- ProgressBar.cs
- MultitargetUtil.cs
- WindowsSolidBrush.cs
- ViewLoader.cs
- HttpCachePolicyElement.cs
- GiveFeedbackEventArgs.cs
- WebPartCloseVerb.cs
- Vector3D.cs
- UnsafeMethods.cs
- CompilationUtil.cs
- DiffuseMaterial.cs
- FlowLayoutPanel.cs
- OperationDescription.cs
- ImageMap.cs
- NamespaceList.cs
- Code.cs
- HotSpotCollection.cs
- EdmToObjectNamespaceMap.cs
- CustomLineCap.cs
- DataSourceCache.cs
- ToolStripRenderEventArgs.cs
- AnimatedTypeHelpers.cs
- TemplateDefinition.cs
- CountdownEvent.cs
- VersionedStreamOwner.cs