Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Animation / EasingFunctionBase.cs / 1305600 / EasingFunctionBase.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation, 2008 // // File: EasingFunctionBase.cs //----------------------------------------------------------------------------- namespace System.Windows.Media.Animation { ////// This class is the base class for many easing functions. /// public abstract class EasingFunctionBase : Freezable, IEasingFunction { ////// EasingMode Property /// public static readonly DependencyProperty EasingModeProperty = DependencyProperty.Register( "EasingMode", typeof(EasingMode), typeof(EasingFunctionBase), new PropertyMetadata(EasingMode.EaseOut)); ////// Specifies the easing behavior. /// public EasingMode EasingMode { get { return (EasingMode)GetValue(EasingModeProperty); } set { SetValueInternal(EasingModeProperty, value); } } ////// Transforms normalized time to control the pace of an animation. /// /// normalized time (progress) of the animation ///transformed progress ///Uses EasingMode in conjunction with EaseInCore to evaluate the easing function. public double Ease(double normalizedTime) { switch (EasingMode) { case EasingMode.EaseIn: return EaseInCore(normalizedTime); case EasingMode.EaseOut: // EaseOut is the same as EaseIn, except time is reversed & the result is flipped. return 1.0 - EaseInCore(1.0 - normalizedTime); case EasingMode.EaseInOut: default: // EaseInOut is a combination of EaseIn & EaseOut fit to the 0-1, 0-1 range. return (normalizedTime < 0.5) ? EaseInCore( normalizedTime * 2.0 ) * 0.5 : (1.0 - EaseInCore((1.0 - normalizedTime) * 2.0)) * 0.5 + 0.5; } } ////// Transforms normalized time to control the pace of an animation for the EaseIn EasingMode /// /// normalized time (progress) of the animation ///transformed progress ////// You only have to specifiy your easing function for the 'EaseIn' case because the implementation /// of Ease will handle transforming normalizedTime & the result of this method to handle 'EaseOut' & 'EaseInOut'. /// protected abstract double EaseInCore(double normalizedTime); } } // 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
- DesignerAttribute.cs
- ConnectionPointCookie.cs
- InvalidEnumArgumentException.cs
- UrlAuthorizationModule.cs
- XamlToRtfWriter.cs
- HttpServerVarsCollection.cs
- DiscoveryExceptionDictionary.cs
- X509Certificate2Collection.cs
- KeyInterop.cs
- GridViewAutomationPeer.cs
- PageThemeCodeDomTreeGenerator.cs
- TraceRecord.cs
- XmlSchemaObject.cs
- CompiledAction.cs
- ColumnClickEvent.cs
- FloatMinMaxAggregationOperator.cs
- SizeKeyFrameCollection.cs
- SourceLineInfo.cs
- InternalsVisibleToAttribute.cs
- ToolStripSettings.cs
- ExternalDataExchangeService.cs
- OdbcConnectionString.cs
- QilSortKey.cs
- ResourceCollectionInfo.cs
- AddInController.cs
- Section.cs
- AccessKeyManager.cs
- RadioButtonAutomationPeer.cs
- ServiceModelActivationSectionGroup.cs
- ToolStripHighContrastRenderer.cs
- SymLanguageVendor.cs
- SettingsSavedEventArgs.cs
- ChangeDirector.cs
- ToolStripRenderer.cs
- TextDecoration.cs
- EntryWrittenEventArgs.cs
- XmlEntityReference.cs
- ServiceMoniker.cs
- SqlServer2KCompatibilityCheck.cs
- _Connection.cs
- InProcStateClientManager.cs
- DrawListViewSubItemEventArgs.cs
- BmpBitmapEncoder.cs
- ProfilePropertySettingsCollection.cs
- IsolatedStorageFilePermission.cs
- DataObject.cs
- Globals.cs
- UserNamePasswordValidator.cs
- WorkflowPersistenceService.cs
- RectangleConverter.cs
- dtdvalidator.cs
- RepeatBehavior.cs
- InkCanvasSelectionAdorner.cs
- CodeAttributeArgument.cs
- TypedRowHandler.cs
- loginstatus.cs
- GeneralTransform3DCollection.cs
- ComplexBindingPropertiesAttribute.cs
- SHA256.cs
- X509Logo.cs
- ZoneLinkButton.cs
- TextFragmentEngine.cs
- LabelDesigner.cs
- ListCollectionView.cs
- dtdvalidator.cs
- ResumeStoryboard.cs
- PresentationSource.cs
- KeyTime.cs
- HtmlProps.cs
- ToolStripControlHost.cs
- SkewTransform.cs
- login.cs
- BindingContext.cs
- SafeNativeMethods.cs
- AssemblyUtil.cs
- DefaultParameterValueAttribute.cs
- SafeSystemMetrics.cs
- RowUpdatingEventArgs.cs
- Soap.cs
- LightweightEntityWrapper.cs
- DoubleLinkListEnumerator.cs
- CuspData.cs
- QueryOutputWriter.cs
- CodeAccessSecurityEngine.cs
- BaseTemplatedMobileComponentEditor.cs
- Int32AnimationBase.cs
- InfoCardKeyedHashAlgorithm.cs
- PersonalizableTypeEntry.cs
- AssociatedControlConverter.cs
- BindUriHelper.cs
- TableMethodGenerator.cs
- UIElement.cs
- HtmlControlPersistable.cs
- ObjectNavigationPropertyMapping.cs
- elementinformation.cs
- HttpServerVarsCollection.cs
- TextMessageEncoder.cs
- OutputCacheSettingsSection.cs
- CollectionChangedEventManager.cs
- Comparer.cs