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
- UpdatePanel.cs
- Verify.cs
- DocumentAutomationPeer.cs
- GridViewCommandEventArgs.cs
- StringWriter.cs
- XmlSignatureProperties.cs
- ScriptManagerProxy.cs
- ButtonColumn.cs
- shaperfactoryquerycachekey.cs
- DataComponentNameHandler.cs
- CategoryAttribute.cs
- recordstatescratchpad.cs
- ThreadStateException.cs
- XmlEventCache.cs
- TargetException.cs
- CatalogZone.cs
- ValidatingPropertiesEventArgs.cs
- PathStreamGeometryContext.cs
- MethodImplAttribute.cs
- FileLogRecordEnumerator.cs
- InvalidComObjectException.cs
- ProjectedSlot.cs
- SaveFileDialog.cs
- DataSourceView.cs
- ExpressionBinding.cs
- DataGridColumnFloatingHeader.cs
- EventHandlerList.cs
- ExtendedProtectionPolicyElement.cs
- ListViewItemSelectionChangedEvent.cs
- SqlAliaser.cs
- IntegerCollectionEditor.cs
- ReadOnlyTernaryTree.cs
- DataServiceException.cs
- CompositeDataBoundControl.cs
- EndpointDiscoveryElement.cs
- WebDescriptionAttribute.cs
- GenericTextProperties.cs
- GroupBox.cs
- ConfigurationPermission.cs
- Pool.cs
- OleDbWrapper.cs
- NetworkInformationException.cs
- TypedOperationInfo.cs
- TextTreeText.cs
- DataServiceRequestException.cs
- ChannelPoolSettingsElement.cs
- QueryStringConverter.cs
- EditorPartChrome.cs
- MaskDescriptors.cs
- OleServicesContext.cs
- WinFormsComponentEditor.cs
- GraphicsState.cs
- UnsafeNativeMethods.cs
- ProfilePropertyMetadata.cs
- CodeSnippetTypeMember.cs
- CloseSequenceResponse.cs
- PathStreamGeometryContext.cs
- sqlnorm.cs
- XamlWriter.cs
- WS2007HttpBindingCollectionElement.cs
- SignedInfo.cs
- MethodBuilderInstantiation.cs
- GeneralTransform3DTo2D.cs
- HttpApplication.cs
- StateManagedCollection.cs
- LinqExpressionNormalizer.cs
- EventDescriptor.cs
- SHA1Managed.cs
- AllMembershipCondition.cs
- ToolStripLabel.cs
- ToolBar.cs
- HtmlForm.cs
- FunctionDescription.cs
- MatrixTransform3D.cs
- EarlyBoundInfo.cs
- UpdateProgress.cs
- SharedUtils.cs
- RuntimeWrappedException.cs
- FirstMatchCodeGroup.cs
- RelatedImageListAttribute.cs
- TextAutomationPeer.cs
- TraceSection.cs
- StorageMappingItemCollection.cs
- LabelEditEvent.cs
- XmlStreamStore.cs
- GiveFeedbackEventArgs.cs
- WebHttpElement.cs
- Table.cs
- SynchronizedDispatch.cs
- InvokePattern.cs
- ColorPalette.cs
- ITreeGenerator.cs
- ResourceIDHelper.cs
- CultureInfo.cs
- ResourcesGenerator.cs
- BStrWrapper.cs
- ISAPIRuntime.cs
- VBIdentifierTrimConverter.cs
- WindowsListViewItemCheckBox.cs
- UserNameSecurityTokenAuthenticator.cs