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
- MissingManifestResourceException.cs
- AutomationElement.cs
- PostBackOptions.cs
- DataSourceControl.cs
- VisualStyleInformation.cs
- AutomationTextAttribute.cs
- InvokeProviderWrapper.cs
- CheckedListBox.cs
- PaintEvent.cs
- UrlUtility.cs
- ModelFactory.cs
- PartitionResolver.cs
- Solver.cs
- LabelLiteral.cs
- FakeModelItemImpl.cs
- Stream.cs
- Converter.cs
- RotationValidation.cs
- PowerModeChangedEventArgs.cs
- SymLanguageType.cs
- WorkflowTimerService.cs
- DefaultObjectMappingItemCollection.cs
- SuppressMergeCheckAttribute.cs
- DataComponentNameHandler.cs
- Compress.cs
- TextRenderer.cs
- XmlSubtreeReader.cs
- ControlParameter.cs
- elementinformation.cs
- SrgsElementFactory.cs
- SQLDoubleStorage.cs
- _TimerThread.cs
- ColumnMapVisitor.cs
- AsnEncodedData.cs
- HtmlInputImage.cs
- ProfileSettingsCollection.cs
- ContextItemManager.cs
- Material.cs
- FormViewInsertEventArgs.cs
- TemplateControlParser.cs
- IncrementalCompileAnalyzer.cs
- TrackingWorkflowEventArgs.cs
- AtomServiceDocumentSerializer.cs
- OperatorExpressions.cs
- WriterOutput.cs
- ArrayMergeHelper.cs
- ConfigurationManagerHelper.cs
- LogLogRecordEnumerator.cs
- TabPanel.cs
- GifBitmapDecoder.cs
- Rotation3D.cs
- XmlBoundElement.cs
- OptionalColumn.cs
- _IPv6Address.cs
- DbgUtil.cs
- DataGridViewLinkCell.cs
- PolygonHotSpot.cs
- MenuItemStyle.cs
- ControlPaint.cs
- CodeExpressionStatement.cs
- WindowsRebar.cs
- SchemaImporter.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- KeyFrames.cs
- ExtentKey.cs
- ToolBar.cs
- DetailsViewModeEventArgs.cs
- AssemblyNameProxy.cs
- UInt32Storage.cs
- CompensationDesigner.cs
- DocumentPageHost.cs
- GradientStop.cs
- CaseCqlBlock.cs
- TypeNameConverter.cs
- SqlUtil.cs
- hresults.cs
- InvalidPropValue.cs
- LazyTextWriterCreator.cs
- InvalidDataException.cs
- UnauthorizedAccessException.cs
- GregorianCalendar.cs
- SymLanguageType.cs
- DesignerUtils.cs
- DataGridViewCellCollection.cs
- AlternateViewCollection.cs
- MenuItemStyleCollection.cs
- TemplatePropertyEntry.cs
- SystemIPInterfaceProperties.cs
- OracleConnectionStringBuilder.cs
- SQLGuid.cs
- IndexingContentUnit.cs
- ResourceKey.cs
- TokenizerHelper.cs
- BroadcastEventHelper.cs
- UriSection.cs
- CustomTrackingQuery.cs
- DataGridColumnEventArgs.cs
- Attributes.cs
- SerializationObjectManager.cs
- SID.cs