Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Animation / PowerEase.cs / 1305600 / PowerEase.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation, 2008
//
// File: PowerEase.cs
//-----------------------------------------------------------------------------
namespace System.Windows.Media.Animation
{
///
/// This class implements an easing function that gives a polynomial curve of arbitrary degree.
/// If the curve you desire is cubic, quadratic, quartic, or quintic it is better to use the
/// specialized easing functions.
///
public class PowerEase : EasingFunctionBase
{
public PowerEase()
{
}
///
/// Power Property
///
public static readonly DependencyProperty PowerProperty =
DependencyProperty.Register(
"Power",
typeof(double),
typeof(PowerEase),
new PropertyMetadata(2.0));
///
/// Specifies the power for the polynomial equation.
///
public double Power
{
get
{
return (double)GetValue(PowerProperty);
}
set
{
SetValueInternal(PowerProperty, value);
}
}
protected override double EaseInCore(double normalizedTime)
{
double power = Math.Max(0.0, Power);
return Math.Pow(normalizedTime, power);
}
protected override Freezable CreateInstanceCore()
{
return new PowerEase();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation, 2008
//
// File: PowerEase.cs
//-----------------------------------------------------------------------------
namespace System.Windows.Media.Animation
{
///
/// This class implements an easing function that gives a polynomial curve of arbitrary degree.
/// If the curve you desire is cubic, quadratic, quartic, or quintic it is better to use the
/// specialized easing functions.
///
public class PowerEase : EasingFunctionBase
{
public PowerEase()
{
}
///
/// Power Property
///
public static readonly DependencyProperty PowerProperty =
DependencyProperty.Register(
"Power",
typeof(double),
typeof(PowerEase),
new PropertyMetadata(2.0));
///
/// Specifies the power for the polynomial equation.
///
public double Power
{
get
{
return (double)GetValue(PowerProperty);
}
set
{
SetValueInternal(PowerProperty, value);
}
}
protected override double EaseInCore(double normalizedTime)
{
double power = Math.Max(0.0, Power);
return Math.Pow(normalizedTime, power);
}
protected override Freezable CreateInstanceCore()
{
return new PowerEase();
}
}
}
// 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
- TransformGroup.cs
- ConfigurationStrings.cs
- DateTimeFormatInfoScanner.cs
- ObjectViewQueryResultData.cs
- ConfigurationElement.cs
- PropertyNames.cs
- SizeAnimationClockResource.cs
- EntityViewGenerationConstants.cs
- IDQuery.cs
- XmlNodeComparer.cs
- ActiveXHost.cs
- SqlFacetAttribute.cs
- DataRow.cs
- MimeParameters.cs
- Debug.cs
- Compress.cs
- WebSysDefaultValueAttribute.cs
- SqlSelectStatement.cs
- AttachedPropertyBrowsableAttribute.cs
- SqlClientWrapperSmiStreamChars.cs
- HttpDictionary.cs
- ApplicationDirectory.cs
- WindowsScrollBarBits.cs
- XamlTypeMapper.cs
- Tracking.cs
- LinkArea.cs
- WebZone.cs
- _ConnectStream.cs
- UTF8Encoding.cs
- VersionedStreamOwner.cs
- ReferenceTypeElement.cs
- MSAAEventDispatcher.cs
- VersionedStreamOwner.cs
- UIntPtr.cs
- Model3D.cs
- ImageCollectionEditor.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- JsonServiceDocumentSerializer.cs
- HtmlTernaryTree.cs
- BrowserCapabilitiesFactoryBase.cs
- _Win32.cs
- _IPv4Address.cs
- PropertyConverter.cs
- DocumentViewerBaseAutomationPeer.cs
- XmlSerializerFactory.cs
- ConditionalAttribute.cs
- FileIOPermission.cs
- PaintValueEventArgs.cs
- ClientApiGenerator.cs
- ServiceModelConfigurationSectionCollection.cs
- EntityContainerEmitter.cs
- BindingContext.cs
- ScopedKnownTypes.cs
- ExtendedProtectionPolicyElement.cs
- ADMembershipUser.cs
- MetadataPropertyCollection.cs
- XmlUrlResolver.cs
- nulltextcontainer.cs
- AggregateNode.cs
- TypedReference.cs
- WorkflowPageSetupDialog.cs
- ActivityMarkupSerializationProvider.cs
- OleDbRowUpdatingEvent.cs
- MethodBuilder.cs
- RSACryptoServiceProvider.cs
- CreateUserWizard.cs
- MenuItemBindingCollection.cs
- SerializationInfo.cs
- DetailsViewRowCollection.cs
- FtpWebRequest.cs
- PinnedBufferMemoryStream.cs
- DataObjectFieldAttribute.cs
- BaseCAMarshaler.cs
- LambdaCompiler.Statements.cs
- DataProviderNameConverter.cs
- EventToken.cs
- HttpPostLocalhostServerProtocol.cs
- PointAnimationUsingKeyFrames.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- RowToParametersTransformer.cs
- RemoteWebConfigurationHostStream.cs
- PlatformCulture.cs
- Transform3D.cs
- Viewport3DVisual.cs
- LeaseManager.cs
- ParserContext.cs
- ConnectionsZone.cs
- JsonDataContract.cs
- Dynamic.cs
- StringBuilder.cs
- CommandHelpers.cs
- TraceData.cs
- MemberAccessException.cs
- ConfigurationElement.cs
- Privilege.cs
- UnionCodeGroup.cs
- TransformFinalBlockRequest.cs
- PrePrepareMethodAttribute.cs
- GlobalItem.cs
- ExpressionBuilder.cs